java.lang.Object | +--org.xml.sax.helpers.ParserAdapterAll Implemented Interfaces:
org.xml.sax.helpers.XMLReaderAdapter
org.xml.sax.XMLReader
org.xml.sax.Parser
ParserAdapter()Construct a new parser adapter. |
ParserAdapter(org.xml.sax.Parser parser)Construct a new parser adapter. |
void | characters(char[] ch, int start, int length)Adapter implementation method; do not call. |
void | endDocument()Adapter implementation method; do not call. |
void | endElement(java.lang.String qName)Adapter implementation method; do not call. |
org.xml.sax.ContentHandler | getContentHandler()Return the current content handler. |
org.xml.sax.DTDHandler | getDTDHandler()Return the current DTD handler. |
org.xml.sax.EntityResolver | getEntityResolver()Return the current entity resolver. |
org.xml.sax.ErrorHandler | getErrorHandler()Return the current error handler. |
boolean | getFeature(java.lang.String name)Check a parser feature flag. |
java.lang.Object | getProperty(java.lang.String name)Get a parser property. |
void | ignorableWhitespace(char[] ch, int start, int length)Adapter implementation method; do not call. |
void | parse(java.lang.String systemId)Parse an XML document. |
void | parse(org.xml.sax.InputSource input)Parse an XML document. |
void | processingInstruction(java.lang.String target, java.lang.String data)Adapter implementation method; do not call. |
void | setContentHandler(org.xml.sax.ContentHandler handler)Set the content handler. |
void | setDTDHandler(org.xml.sax.DTDHandler handler)Set the DTD handler. |
void | setDocumentLocator(org.xml.sax.Locator locator)Adapter implementation method; do not call. |
void | setEntityResolver(org.xml.sax.EntityResolver resolver)Set the entity resolver. |
void | setErrorHandler(org.xml.sax.ErrorHandler handler)Set the error handler. |
void | setFeature(java.lang.String name, boolean value)Set a feature flag for the parser. |
void | setProperty(java.lang.String name, java.lang.Object value)Set a parser property. |
void | startDocument()Adapter implementation method; do not call. |
void | startElement(java.lang.String qName, org.xml.sax.AttributeList qAtts)Adapter implementation method; do not call. |
public ParserAdapter()Use the "org.xml.sax.parser" property to locate the embedded SAX1 driver.
SAXException - If the embedded driver
cannot be instantiated or if the
org.xml.sax.parser property is not specified.public ParserAdapter(org.xml.sax.Parser parser)Note that the embedded parser cannot be changed once the adapter is created; to embed a different parser, allocate a new ParserAdapter.
parser - The SAX1 parser to embed.NullPointerException - If the parser parameter
is null.public void characters(char[] ch, int start, int length)ch - An array of characters.start - The starting position in the array.length - The number of characters to use.SAXException - The client may raise a
processing exception.public void endDocument()SAXException - The client may raise a
processing exception.public void endElement(java.lang.String qName)qName - The qualified (prefixed) name.SAXException - The client may raise a
processing exception.public ContentHandler getContentHandler()public DTDHandler getDTDHandler()public EntityResolver getEntityResolver()public ErrorHandler getErrorHandler()public boolean getFeature(java.lang.String name)The only features recognized are namespaces and namespace-prefixes.
name - The feature name, as a complete URI.SAXNotRecognizedException - If the feature
value can't be assigned or retrieved.SAXNotSupportedException - If the
feature is not currently readable.public Object getProperty(java.lang.String name)No properties are currently recognized.
name - The property name.SAXNotRecognizedException - If the property
value can't be assigned or retrieved.SAXNotSupportedException - If the property
value is not currently readable.public void ignorableWhitespace(char[] ch, int start, int length)ch - An array of characters.start - The starting position in the array.length - The number of characters to use.SAXException - The client may raise a
processing exception.public void parse(java.lang.String systemId)systemId - The absolute URL of the document.IOException - If there is a problem reading
the raw content of the document.SAXException - If there is a problem
processing the document.public void parse(org.xml.sax.InputSource input)input - An input source for the document.IOException - If there is a problem reading
the raw content of the document.SAXException - If there is a problem
processing the document.public void processingInstruction(java.lang.String target, java.lang.String data)target - The processing instruction target.data - The remainder of the processing instructionSAXException - The client may raise a
processing exception.public void setContentHandler(org.xml.sax.ContentHandler handler)handler - The new content handler.public void setDTDHandler(org.xml.sax.DTDHandler handler)handler - The new DTD handler.public void setDocumentLocator(org.xml.sax.Locator locator)locator - A document locator.public void setEntityResolver(org.xml.sax.EntityResolver resolver)resolver - The new entity resolver.public void setErrorHandler(org.xml.sax.ErrorHandler handler)handler - The new error handler.public void setFeature(java.lang.String name, boolean value)The only features recognized are namespaces and namespace-prefixes.
name - The feature name, as a complete URI.value - The requested feature value.SAXNotRecognizedException - If the feature
can't be assigned or retrieved.SAXNotSupportedException - If the feature
can't be assigned that value.public void setProperty(java.lang.String name, java.lang.Object value)No properties are currently recognized.
name - The property name.value - The property value.SAXNotRecognizedException - If the property
value can't be assigned or retrieved.SAXNotSupportedException - If the property
can't be assigned that value.public void startDocument()SAXException - The client may raise a
processing exception.public void startElement(java.lang.String qName, org.xml.sax.AttributeList qAtts)If necessary, perform Namespace processing.
qName - The qualified (prefixed) name.qAtts - The XML 1.0 attribute list (with qnames).SAXException - The client may raise a
processing exception.
This class wraps a SAX1 org.xml.sax.Parser Parser and makes it act as a SAX2 org.xml.sax.XMLReader XMLReader, with feature, property, and Namespace support. Note that it is not possible to report org.xml.sax.ContentHandler#skippedEntity skippedEntity events, since SAX1 does not make that information available.
This adapter does not test for duplicate Namespace-qualified attribute names.