Package org.opencastproject.smil.entity
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
Smil implementation.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all content in head and body.static org.opencastproject.smil.entity.api.SmilUnmarshall a SMIL document from file.static org.opencastproject.smil.entity.api.SmilUnmarshall a SMIL document from string.org.opencastproject.smil.entity.api.SmilObjectorg.opencastproject.smil.entity.api.SmilBodygetBody()org.opencastproject.smil.entity.api.SmilObjectgetElementOrNull(String elementId) Returns element with given elementId or null.org.opencastproject.smil.entity.api.SmilHeadgetHead()protected StringReturnsSmilObjectId prefix (must begin with alphanumeric charackter).voidputAllChilds(List<org.opencastproject.smil.entity.api.SmilObject> elements) Put all containing elements intoListgiven as parameter.org.opencastproject.smil.entity.api.SmilObjectremoveElement(String elementId) Remove element with given Id and returns it.voidsetBody(org.opencastproject.smil.entity.api.SmilBody body) Set the body of the SMIL.voidsetHead(org.opencastproject.smil.entity.api.SmilHead head) Set the head of the SMIL.toXML()Methods inherited from class org.opencastproject.smil.entity.SmilObjectImpl
getIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
getHeadin interfaceorg.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:
getBodyin interfaceorg.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
ReturnsSmilObjectId prefix (must begin with alphanumeric charackter).- Specified by:
getIdPrefixin classSmilObjectImpl- Returns:
- Id prefix
-
removeElement
Remove element with given Id and returns it. Returns null if there is no element with given Id.- Specified by:
removeElementin classSmilObjectImpl- Parameters:
elementId- element Id- Returns:
- removed element or null
-
toXML
- Specified by:
toXMLin interfaceorg.opencastproject.smil.entity.api.Smil- Throws:
javax.xml.bind.JAXBExceptionSAXExceptionMalformedURLException
-
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-Smildocument 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-Smildocument 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
Returns element with given elementId or null.- Specified by:
getElementOrNullin classSmilObjectImpl- Parameters:
elementId- element Id- Returns:
- element with given elementId or null
-
putAllChilds
Put all containing elements intoListgiven as parameter.- Specified by:
putAllChildsin classSmilObjectImpl- Parameters:
elements-Listwhere to pul child elements to
-
get
public org.opencastproject.smil.entity.api.SmilObject get(String elementId) throws org.opencastproject.smil.api.SmilException - Specified by:
getin interfaceorg.opencastproject.smil.entity.api.Smil- Throws:
org.opencastproject.smil.api.SmilException
-