Class Mpeg7Parser
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.opencastproject.metadata.mpeg7.Mpeg7Parser
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
Parser implementation for mpeg-7 files. Note that this implementation does by far not cover the full mpeg-7 standard
but only deals with those parts relevant to Opencast, mainly temporal decompositions.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new parser for mpeg-7 files.Mpeg7Parser(Mpeg7CatalogImpl catalog) -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) voidendElement(String uri, String localName, String name) voidvoidparse(InputStream is) Parses the mpeg-7 catalog file and returns its object representation.voidstartElement(String uri, String localName, String name, Attributes attributes) Readtypeattribute from track or catalog element.voidMethods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDeclMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
Mpeg7Parser
public Mpeg7Parser()Creates a new parser for mpeg-7 files. -
Mpeg7Parser
-
-
Method Details
-
parse
public Mpeg7CatalogImpl parse(InputStream is) throws ParserConfigurationException, SAXException, IOException Parses the mpeg-7 catalog file and returns its object representation.- Parameters:
is- the input stream containing the catalog- Returns:
- the catalog representation
- Throws:
ParserConfigurationException- if setting up the parser failedSAXException- if an error occured while parsing the documentIOException- if the file cannot be accessed in a proper wayIllegalArgumentException- if the provided file does not contain mpeg-7 data
-
startElement
public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException Readtypeattribute from track or catalog element.- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException- See Also:
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException- See Also:
-
characters
- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Throws:
SAXException- See Also:
-
error
- Specified by:
errorin interfaceErrorHandler- Overrides:
errorin classDefaultHandler- Throws:
SAXException- See Also:
-
fatalError
- Specified by:
fatalErrorin interfaceErrorHandler- Overrides:
fatalErrorin classDefaultHandler- Throws:
SAXException- See Also:
-
warning
- Specified by:
warningin interfaceErrorHandler- Overrides:
warningin classDefaultHandler- Throws:
SAXException- See Also:
-