Class ParsingContentHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.jackrabbit.commons.xml.DefaultContentHandler
-
- org.apache.jackrabbit.commons.xml.ParsingContentHandler
-
- All Implemented Interfaces:
org.xml.sax.ContentHandler
,org.xml.sax.DTDHandler
,org.xml.sax.EntityResolver
,org.xml.sax.ErrorHandler
public class ParsingContentHandler extends DefaultContentHandler
Utility class that decorates aContentHandler
instance with simple XML parsing capability.- Since:
- Jackrabbit JCR Commons 1.5
-
-
Constructor Summary
Constructors Constructor Description ParsingContentHandler(org.xml.sax.ContentHandler handler)
Creates aDefaultHandler
adapter for the given content handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
parse(java.io.InputStream in)
Utility method that parses the given input stream using this handler.org.xml.sax.InputSource
resolveEntity(java.lang.String publicId, java.lang.String systemId)
Returns an empty stream to prevent the XML parser from attempting to resolve external entity references.-
Methods inherited from class org.apache.jackrabbit.commons.xml.DefaultContentHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping
-
-
-
-
Method Detail
-
parse
public void parse(java.io.InputStream in) throws java.io.IOException, org.xml.sax.SAXException
Utility method that parses the given input stream using this handler. The parser is namespace-aware and will not resolve external entity references.- Parameters:
in
- XML input stream- Throws:
java.io.IOException
- if an I/O error occursorg.xml.sax.SAXException
- if an XML parsing error occurs
-
resolveEntity
public org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
Returns an empty stream to prevent the XML parser from attempting to resolve external entity references.- Specified by:
resolveEntity
in interfaceorg.xml.sax.EntityResolver
- Overrides:
resolveEntity
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
-
-