public final class XercesParser extends org.apache.avalon.framework.logger.AbstractLogEnabled implements SAXParser, DOMParser, org.xml.sax.ErrorHandler, org.apache.avalon.framework.thread.ThreadSafe, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.component.Component
| Constructor and Description |
|---|
XercesParser() |
| Modifier and Type | Method and Description |
|---|---|
org.w3c.dom.Document |
createDocument()
Return a new
Document. |
private org.apache.xerces.parsers.SAXParser |
createSAXParser()
Utility method to create a SAXParser.
|
void |
error(org.xml.sax.SAXParseException spe)
Receive notification of a recoverable error.
|
void |
fatalError(org.xml.sax.SAXParseException spe)
Receive notification of a fatal error.
|
void |
initialize() |
void |
parse(org.xml.sax.InputSource in,
org.xml.sax.ContentHandler consumer)
Parse the
InputSource and send
SAX events to the consumer. |
void |
parse(org.xml.sax.InputSource in,
org.xml.sax.ContentHandler contentHandler,
org.xml.sax.ext.LexicalHandler lexicalHandler)
Parse the
InputSource and send
SAX events to the content handler and
the lexical handler. |
org.w3c.dom.Document |
parseDocument(org.xml.sax.InputSource input)
Parses a new Document object from the given
InputSource. |
void |
warning(org.xml.sax.SAXParseException spe)
Receive notification of a warning.
|
public void initialize()
throws java.lang.Exception
initialize in interface org.apache.avalon.framework.activity.Initializablejava.lang.Exceptionpublic void parse(org.xml.sax.InputSource in,
org.xml.sax.ContentHandler consumer)
throws org.xml.sax.SAXException,
java.io.IOException
SAXParserInputSource and send
SAX events to the consumer.
Attention: the consumer can implement the
LexicalHandler as well.
The parse should take care of this.public void parse(org.xml.sax.InputSource in,
org.xml.sax.ContentHandler contentHandler,
org.xml.sax.ext.LexicalHandler lexicalHandler)
throws org.xml.sax.SAXException,
java.io.IOException
InputSource and send
SAX events to the content handler and
the lexical handler.public org.w3c.dom.Document parseDocument(org.xml.sax.InputSource input)
throws org.xml.sax.SAXException,
java.io.IOException
InputSource.parseDocument in interface DOMParserorg.xml.sax.SAXExceptionjava.io.IOExceptionpublic org.w3c.dom.Document createDocument()
throws org.xml.sax.SAXException
Document.createDocument in interface DOMParserorg.xml.sax.SAXExceptionpublic void error(org.xml.sax.SAXParseException spe)
throws org.xml.sax.SAXException
error in interface org.xml.sax.ErrorHandlerorg.xml.sax.SAXExceptionpublic void fatalError(org.xml.sax.SAXParseException spe)
throws org.xml.sax.SAXException
fatalError in interface org.xml.sax.ErrorHandlerorg.xml.sax.SAXExceptionpublic void warning(org.xml.sax.SAXParseException spe)
throws org.xml.sax.SAXException
warning in interface org.xml.sax.ErrorHandlerorg.xml.sax.SAXExceptionprivate org.apache.xerces.parsers.SAXParser createSAXParser()
throws org.xml.sax.SAXException
org.xml.sax.SAXException - if unable to create parser