Class SmilImpl

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

public class SmilImpl extends SmilObjectImpl implements org.opencastproject.smil.entity.api.Smil
Smil implementation.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Empty constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clear all content in head and body.
    static org.opencastproject.smil.entity.api.Smil
    fromXML(File xmlFile)
    Unmarshall a SMIL document from file.
    static org.opencastproject.smil.entity.api.Smil
    Unmarshall a SMIL document from string.
    org.opencastproject.smil.entity.api.SmilObject
    get(String elementId)
    org.opencastproject.smil.entity.api.SmilBody
    org.opencastproject.smil.entity.api.SmilObject
    Returns element with given elementId or null.
    org.opencastproject.smil.entity.api.SmilHead
    protected String
    Returns SmilObject Id prefix (must begin with alphanumeric charackter).
    void
    putAllChilds(List<org.opencastproject.smil.entity.api.SmilObject> elements)
    Put all containing elements into List given as parameter.
    org.opencastproject.smil.entity.api.SmilObject
    removeElement(String elementId)
    Remove element with given Id and returns it.
    void
    setBody(org.opencastproject.smil.entity.api.SmilBody body)
    Set the body of the SMIL.
    void
    setHead(org.opencastproject.smil.entity.api.SmilHead head)
    Set the head of the SMIL.

    Methods inherited from class org.opencastproject.smil.entity.SmilObjectImpl

    getId

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.opencastproject.smil.entity.api.SmilObject

    getId
  • Constructor Details

    • SmilImpl

      public SmilImpl()
      Empty constructor.
  • Method Details

    • getHead

      public org.opencastproject.smil.entity.api.SmilHead getHead()
      Specified by:
      getHead in interface org.opencastproject.smil.entity.api.Smil
    • setHead

      public void setHead(org.opencastproject.smil.entity.api.SmilHead head)
      Set the head of the SMIL.
      Parameters:
      head - the head to set
    • getBody

      public org.opencastproject.smil.entity.api.SmilBody getBody()
      Specified by:
      getBody in interface org.opencastproject.smil.entity.api.Smil
    • setBody

      public void setBody(org.opencastproject.smil.entity.api.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 org.opencastproject.smil.entity.api.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
      Specified by:
      toXML in interface org.opencastproject.smil.entity.api.Smil
      Throws:
      javax.xml.bind.JAXBException
      SAXException
      MalformedURLException
    • fromXML

      public static org.opencastproject.smil.entity.api.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 org.opencastproject.smil.entity.api.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 org.opencastproject.smil.entity.api.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<org.opencastproject.smil.entity.api.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 org.opencastproject.smil.entity.api.SmilObject get(String elementId) throws org.opencastproject.smil.api.SmilException
      Specified by:
      get in interface org.opencastproject.smil.entity.api.Smil
      Throws:
      org.opencastproject.smil.api.SmilException