Package com.sun.xml.xsom.parser
Class JAXPParser
java.lang.Object
com.sun.xml.xsom.parser.JAXPParser
- All Implemented Interfaces:
XMLParser
Standard XMLParser implemented by using JAXP.
- Author:
- Kohsuke Kawaguchi ([email protected])
-
Constructor Summary
ConstructorDescriptionJAXPParser
(SAXParserFactory factory) Creates a new JAXPParser that uses the given SAXParserFactory for creating new XMLReaders. -
Method Summary
Modifier and TypeMethodDescriptionvoid
parse
(InputSource source, ContentHandler handler, ErrorHandler errorHandler, EntityResolver entityResolver) Parses the document identified by the given input source and sends SAX events to the given content handler.
-
Constructor Details
-
JAXPParser
Creates a new JAXPParser that uses the given SAXParserFactory for creating new XMLReaders.The caller needs to configure it properly with security features initialized by setting XMLConstants.FEATURE_SECURE_PROCESSING feature. Also don't forget to call
setNamespaceAware(true)
or you'll see some strange errors.
-
-
Method Details
-
parse
public void parse(InputSource source, ContentHandler handler, ErrorHandler errorHandler, EntityResolver entityResolver) throws SAXException, IOException Description copied from interface:XMLParser
Parses the document identified by the given input source and sends SAX events to the given content handler.This method must be re-entrant.
- Specified by:
parse
in interfaceXMLParser
errorHandler
- Errors found during the parsing must be reported to this handler so that XSOM can recognize that something went wrong. Always a non-null valid objectentityResolver
- Entity resolution should be done through this interface. Can be null.- Throws:
SAXException
- If ErrorHandler throws a SAXException, this method will tunnel it to the caller. All the other errors must be reported to the error handler.IOException
-