Package edu.ucsb.nceas.metacat.service
Class XMLSchemaParser
java.lang.Object
org.xml.sax.helpers.DefaultHandler
edu.ucsb.nceas.metacat.service.XMLSchemaParser
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
A class will parse an schema file to get information - such as included
xsd files in this schema
- Author:
- tao
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the included schema file paths in this schemavoid
parse()
Parse the schema filevoid
startElement
(String uri, String localName, String qName, Attributes atts) SAX Handler that is called at the start of each XML elementMethods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
XMLSchemaParser
public XMLSchemaParser(InputStream schemaIn) throws SAXException, edu.ucsb.nceas.utilities.PropertyNotFoundException Constructor- Parameters:
schemaIn
- the schema content as an InputStream object- Throws:
SAXException
edu.ucsb.nceas.utilities.PropertyNotFoundException
-
-
Method Details
-
parse
Parse the schema file- Throws:
SAXException
- if some sax related exception happensIOException
- if the schema content couldn't be found
-
getIncludedSchemaFilePathes
Get the included schema file paths in this schema- Returns:
- the included schema file paths
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException SAX Handler that is called at the start of each XML element- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-