Class SmilImpl

java.lang.Object
org.opencastproject.smil.entity.SmilObjectImpl
org.opencastproject.smil.entity.SmilImpl
All Implemented Interfaces:
Smil, SmilObject

public class SmilImpl extends SmilObjectImpl implements Smil
Smil implementation.
  • Constructor Details

    • SmilImpl

      public SmilImpl()
      Empty constructor.
  • Method Details

    • getHead

      public SmilHead getHead()
      Returns head of the SMIL.
      Specified by:
      getHead in interface Smil
      Returns:
      the head of the SMIL.
    • setHead

      public void setHead(SmilHead head)
      Set the head of the SMIL.
      Parameters:
      head - the head to set
    • getBody

      public SmilBody getBody()
      Returns body of the SMIL.
      Specified by:
      getBody in interface Smil
      Returns:
      the body of the SMIL.
    • setBody

      public void setBody(SmilBody body)
      Set the body of the SMIL.
      Parameters:
      body - the body to set
    • getIdPrefix

      protected String getIdPrefix()
      Returns SmilObject Id prefix (must begin with alphanumeric charackter).
      Specified by:
      getIdPrefix in class SmilObjectImpl
      Returns:
      Id prefix
    • removeElement

      public SmilObject removeElement(String elementId)
      Remove element with given Id and returns it. Returns null if there is no element with given Id.
      Specified by:
      removeElement in class SmilObjectImpl
      Parameters:
      elementId - element Id
      Returns:
      removed element or null
    • toXML

      public String toXML() throws javax.xml.bind.JAXBException, SAXException, MalformedURLException
      Serialize this object.
      Specified by:
      toXML in interface Smil
      Returns:
      the XML representation of the Smil object
      Throws:
      javax.xml.bind.JAXBException - if serializing fail
      SAXException
      MalformedURLException
    • fromXML

      public static Smil fromXML(String xml) throws javax.xml.bind.JAXBException
      Unmarshall a SMIL document from string.
      Parameters:
      xml - Smil document as xml
      Returns:
      parsed Smil
      Throws:
      javax.xml.bind.JAXBException - if unmarshalling fail
    • fromXML

      public static Smil fromXML(File xmlFile) throws javax.xml.bind.JAXBException
      Unmarshall a SMIL document from file.
      Parameters:
      xmlFile - Smil document as file
      Returns:
      parsed Smil
      Throws:
      javax.xml.bind.JAXBException - if unmarshalling fail
    • clear

      public void clear()
      Clear all content in head and body.
    • getElementOrNull

      public SmilObject getElementOrNull(String elementId)
      Returns element with given elementId or null.
      Specified by:
      getElementOrNull in class SmilObjectImpl
      Parameters:
      elementId - element Id
      Returns:
      element with given elementId or null
    • putAllChilds

      public void putAllChilds(List<SmilObject> elements)
      Put all containing elements into List given as parameter.
      Specified by:
      putAllChilds in class SmilObjectImpl
      Parameters:
      elements - List where to pul child elements to
    • get

      public SmilObject get(String elementId) throws SmilException
      Returns element with given Id.
      Specified by:
      get in interface Smil
      Parameters:
      elementId - element Id
      Returns:
      element with given Id
      Throws:
      SmilException - if there is no element with the same Id