public class ParsingContentHandler extends DefaultContentHandler
ContentHandler
instance with
simple XML parsing capability.Constructor and Description |
---|
ParsingContentHandler(ContentHandler handler)
Creates a
DefaultHandler adapter for the given content
handler. |
Modifier and Type | Method and Description |
---|---|
void |
parse(InputStream in)
Utility method that parses the given input stream using this handler.
|
InputSource |
resolveEntity(String publicId,
String systemId)
Returns an empty stream to prevent the XML parser from attempting
to resolve external entity references.
|
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping
error, fatalError, notationDecl, unparsedEntityDecl, warning
public ParsingContentHandler(ContentHandler handler)
DefaultHandler
adapter for the given content
handler.handler
- content handlerpublic void parse(InputStream in) throws IOException, SAXException
in
- XML input streamIOException
- if an I/O error occursSAXException
- if an XML parsing error occurspublic InputSource resolveEntity(String publicId, String systemId) throws SAXException
resolveEntity
in interface EntityResolver
resolveEntity
in class DefaultHandler
SAXException
Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.