Package edu.ucsb.nceas.metacat
Class DBSAXHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
edu.ucsb.nceas.metacat.DBSAXHandler
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler,DeclHandler,LexicalHandler
A database aware Class implementing callback bethods for the SAX parser to
call when processing the XML stream and generating events.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSAX Handler that receives notification of attribute declarationsvoidcharacters(char[] cbuf, int start, int len) SAX Handler that is called for each XML text nodevoidcomment(char[] ch, int start, int length) SAX Handler that receives notification of comments in the DTDvoidelementDecl(String name, String model) SAX Handler that receives notification of element declarationsvoidendCDATA()SAX Handler that receives notification of the end of CDATA sectionsvoidSAX Handler that receives notification of end of the documentvoidendDTD()SAX Handler that receives notification of end of DTDvoidendElement(String uri, String localName, String qName) SAX Handler that is called at the end of each XML elementvoidSAX Handler that receives notification of the end of entitiesvoiderror(SAXParseException exception) SAX Handler that receives notification of recoverable parsing errorsvoidexternalEntityDecl(String name, String publicId, String systemId) SAX Handler that receives notification of external entity declarationsvoidfatalError(SAXParseException exception) SAX Handler that receives notification of fatal parsing errorsget the document nameGet the name of the documentvoidignorableWhitespace(char[] cbuf, int start, int len) SAX Handler that is called for each XML text node that is Ignorable white spacevoidinternalEntityDecl(String name, String value) SAX Handler that receives notification of internal entity declarationsbooleanget the document processing statevoidprocessingInstruction(String target, String data) SAX Handler called once for each processing instruction found: node that PI may occur before or after the root element.voidSAX Handler that receives notification of the start of CDATA sectionsvoidSAX Handler that receives notification of beginning of the documentvoidSAX Handler that receives notification of DOCTYPE.voidstartElement(String uri, String localName, String qName, Attributes atts) SAX Handler that is called at the start of each XML elementvoidstartEntity(String name) SAX Handler that receives notification of the start of entitiesvoidstartPrefixMapping(String prefix, String uri) SAX Handler that is called at the start of Namespacevoidwarning(SAXParseException exception) SAX Handler that receives notification of warningsMethods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, notationDecl, resolveEntity, setDocumentLocator, skippedEntity, 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
-
Field Details
-
NODE_ID
public static final long NODE_ID- See Also:
-
atFirstElement
protected boolean atFirstElement -
processingDTD
protected boolean processingDTD -
docname
-
doctype
-
catalogid
-
systemid
-
namespaces
-
hitTextNode
protected boolean hitTextNode -
textBuffer
-
MAXDATACHARS
public static final int MAXDATACHARS- See Also:
-
SCHEMALOCATIONKEYWORD
- See Also:
-
endNodeId
protected long endNodeId -
schemaList
-
ECOGRID
- See Also:
-
-
Constructor Details
-
DBSAXHandler
public DBSAXHandler()Construct an instance of the handler class
-
-
Method Details
-
startDocument
SAX Handler that receives notification of beginning of the document- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classDefaultHandler- Throws:
SAXException
-
endDocument
SAX Handler that receives notification of end of the document- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classDefaultHandler- Throws:
SAXException
-
startPrefixMapping
SAX Handler that is called at the start of Namespace- Specified by:
startPrefixMappingin interfaceContentHandler- Overrides:
startPrefixMappingin classDefaultHandler- Throws:
SAXException
-
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:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
characters
SAX Handler that is called for each XML text node- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Throws:
SAXException
-
ignorableWhitespace
SAX Handler that is called for each XML text node that is Ignorable white space- Specified by:
ignorableWhitespacein interfaceContentHandler- Overrides:
ignorableWhitespacein classDefaultHandler- Throws:
SAXException
-
processingInstruction
SAX Handler called once for each processing instruction found: node that PI may occur before or after the root element.- Specified by:
processingInstructionin interfaceContentHandler- Overrides:
processingInstructionin classDefaultHandler- Throws:
SAXException
-
endElement
SAX Handler that is called at the end of each XML element- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-
startDTD
SAX Handler that receives notification of DOCTYPE. Sets the DTD- Specified by:
startDTDin interfaceLexicalHandler- Throws:
SAXException
-
endDTD
SAX Handler that receives notification of end of DTD- Specified by:
endDTDin interfaceLexicalHandler- Throws:
SAXException
-
comment
SAX Handler that receives notification of comments in the DTD- Specified by:
commentin interfaceLexicalHandler- Throws:
SAXException
-
startCDATA
SAX Handler that receives notification of the start of CDATA sections- Specified by:
startCDATAin interfaceLexicalHandler- Throws:
SAXException
-
endCDATA
SAX Handler that receives notification of the end of CDATA sections- Specified by:
endCDATAin interfaceLexicalHandler- Throws:
SAXException
-
startEntity
SAX Handler that receives notification of the start of entities- Specified by:
startEntityin interfaceLexicalHandler- Throws:
SAXException
-
endEntity
SAX Handler that receives notification of the end of entities- Specified by:
endEntityin interfaceLexicalHandler- Throws:
SAXException
-
elementDecl
SAX Handler that receives notification of element declarations- Specified by:
elementDeclin interfaceDeclHandler- Throws:
SAXException
-
attributeDecl
public void attributeDecl(String eName, String aName, String type, String valueDefault, String value) throws SAXException SAX Handler that receives notification of attribute declarations- Specified by:
attributeDeclin interfaceDeclHandler- Throws:
SAXException
-
internalEntityDecl
SAX Handler that receives notification of internal entity declarations- Specified by:
internalEntityDeclin interfaceDeclHandler- Throws:
SAXException
-
externalEntityDecl
SAX Handler that receives notification of external entity declarations- Specified by:
externalEntityDeclin interfaceDeclHandler- Throws:
SAXException
-
fatalError
SAX Handler that receives notification of fatal parsing errors- Specified by:
fatalErrorin interfaceErrorHandler- Overrides:
fatalErrorin classDefaultHandler- Throws:
SAXException
-
error
SAX Handler that receives notification of recoverable parsing errors- Specified by:
errorin interfaceErrorHandler- Overrides:
errorin classDefaultHandler- Throws:
SAXException
-
warning
SAX Handler that receives notification of warnings- Specified by:
warningin interfaceErrorHandler- Overrides:
warningin classDefaultHandler- Throws:
SAXException
-
getDocname
get the document name -
processingDTD
public boolean processingDTD()get the document processing state -
getDocumentName
Get the name of the document- Returns:
- the name of the document
-