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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
SAX Handler that receives notification of attribute declarationsvoid
characters
(char[] cbuf, int start, int len) SAX Handler that is called for each XML text nodevoid
comment
(char[] ch, int start, int length) SAX Handler that receives notification of comments in the DTDvoid
elementDecl
(String name, String model) SAX Handler that receives notification of element declarationsvoid
endCDATA()
SAX Handler that receives notification of the end of CDATA sectionsvoid
SAX Handler that receives notification of end of the documentvoid
endDTD()
SAX Handler that receives notification of end of DTDvoid
endElement
(String uri, String localName, String qName) SAX Handler that is called at the end of each XML elementvoid
SAX Handler that receives notification of the end of entitiesvoid
error
(SAXParseException exception) SAX Handler that receives notification of recoverable parsing errorsvoid
externalEntityDecl
(String name, String publicId, String systemId) SAX Handler that receives notification of external entity declarationsvoid
fatalError
(SAXParseException exception) SAX Handler that receives notification of fatal parsing errorsget the document nameGet the name of the documentvoid
ignorableWhitespace
(char[] cbuf, int start, int len) SAX Handler that is called for each XML text node that is Ignorable white spacevoid
internalEntityDecl
(String name, String value) SAX Handler that receives notification of internal entity declarationsboolean
get the document processing statevoid
processingInstruction
(String target, String data) SAX Handler called once for each processing instruction found: node that PI may occur before or after the root element.void
SAX Handler that receives notification of the start of CDATA sectionsvoid
SAX Handler that receives notification of beginning of the documentvoid
SAX Handler that receives notification of DOCTYPE.void
startElement
(String uri, String localName, String qName, Attributes atts) SAX Handler that is called at the start of each XML elementvoid
startEntity
(String name) SAX Handler that receives notification of the start of entitiesvoid
startPrefixMapping
(String prefix, String uri) SAX Handler that is called at the start of Namespacevoid
warning
(SAXParseException exception) SAX Handler that receives notification of warningsMethods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, notationDecl, resolveEntity, setDocumentLocator, skippedEntity, unparsedEntityDecl
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
-
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:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in classDefaultHandler
- Throws:
SAXException
-
endDocument
SAX Handler that receives notification of end of the document- Specified by:
endDocument
in interfaceContentHandler
- Overrides:
endDocument
in classDefaultHandler
- Throws:
SAXException
-
startPrefixMapping
SAX Handler that is called at the start of Namespace- Specified by:
startPrefixMapping
in interfaceContentHandler
- Overrides:
startPrefixMapping
in 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:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-
characters
SAX Handler that is called for each XML text node- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classDefaultHandler
- Throws:
SAXException
-
ignorableWhitespace
SAX Handler that is called for each XML text node that is Ignorable white space- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Overrides:
ignorableWhitespace
in 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:
processingInstruction
in interfaceContentHandler
- Overrides:
processingInstruction
in classDefaultHandler
- Throws:
SAXException
-
endElement
SAX Handler that is called at the end of each XML element- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
- Throws:
SAXException
-
startDTD
SAX Handler that receives notification of DOCTYPE. Sets the DTD- Specified by:
startDTD
in interfaceLexicalHandler
- Throws:
SAXException
-
endDTD
SAX Handler that receives notification of end of DTD- Specified by:
endDTD
in interfaceLexicalHandler
- Throws:
SAXException
-
comment
SAX Handler that receives notification of comments in the DTD- Specified by:
comment
in interfaceLexicalHandler
- Throws:
SAXException
-
startCDATA
SAX Handler that receives notification of the start of CDATA sections- Specified by:
startCDATA
in interfaceLexicalHandler
- Throws:
SAXException
-
endCDATA
SAX Handler that receives notification of the end of CDATA sections- Specified by:
endCDATA
in interfaceLexicalHandler
- Throws:
SAXException
-
startEntity
SAX Handler that receives notification of the start of entities- Specified by:
startEntity
in interfaceLexicalHandler
- Throws:
SAXException
-
endEntity
SAX Handler that receives notification of the end of entities- Specified by:
endEntity
in interfaceLexicalHandler
- Throws:
SAXException
-
elementDecl
SAX Handler that receives notification of element declarations- Specified by:
elementDecl
in 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:
attributeDecl
in interfaceDeclHandler
- Throws:
SAXException
-
internalEntityDecl
SAX Handler that receives notification of internal entity declarations- Specified by:
internalEntityDecl
in interfaceDeclHandler
- Throws:
SAXException
-
externalEntityDecl
SAX Handler that receives notification of external entity declarations- Specified by:
externalEntityDecl
in interfaceDeclHandler
- Throws:
SAXException
-
fatalError
SAX Handler that receives notification of fatal parsing errors- Specified by:
fatalError
in interfaceErrorHandler
- Overrides:
fatalError
in classDefaultHandler
- Throws:
SAXException
-
error
SAX Handler that receives notification of recoverable parsing errors- Specified by:
error
in interfaceErrorHandler
- Overrides:
error
in classDefaultHandler
- Throws:
SAXException
-
warning
SAX Handler that receives notification of warnings- Specified by:
warning
in interfaceErrorHandler
- Overrides:
warning
in 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
-