References Deprecated
DocumentHandler is deprecated or references (maybe indirectly) at least one deprecated element.
See corresponding docs for further information.
This class wraps a SAX1 Parser
and makes it act as a SAX2 XMLReader,
with feature, property, and Namespace support. Note
that it is not possible to report skippedEntity events, since SAX1 does not make that information available.
This adapter does not test for duplicate Namespace-qualified attribute names.
org.xml.sax.helpers.XMLReaderAdapter , org.xml.sax.XMLReader , org.xml.sax.Parser
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | ParserAdapter.
Adapt a SAX1 AttributeList as a SAX2 Attributes object. |
| Modifier and Type | Field and Description |
|---|---|
| private ParserAdapter. | |
| private AttributesImpl | |
| pack-priv ContentHandler | |
| pack-priv DTDHandler | |
| pack-priv EntityResolver | |
| pack-priv ErrorHandler | |
| private static final String | |
| pack-priv Locator | |
| private String[] | |
| private static final String | |
| private static final String | |
| private boolean | |
| private NamespaceSupport | |
| private Parser | |
| private boolean | |
| private boolean | |
| private boolean | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ParserAdapter(Parser
The SAX1 parser to embed. parser)
References Deprecated
Parser is deprecated or references (maybe indirectly) at least one deprecated element.
Construct a new parser adapter. |
| Modifier and Type | Method and Description |
|---|---|
| public void | characters(char[]
An array of characters. ch, int The starting position in the array. start, int The number of characters to use. length)Implements org. Adapter implementation method; do not call. |
| private void | checkNotParsing(String
The type of thing (feature or property). type, String The feature or property name. name)Throw an exception if we are parsing. |
| public void | endDocument()
Implements org. Adapter implementation method; do not call. |
| public void | endElement(String
The qualified (prefixed) name. qName)Implements org. Adapter implementation method; do not call. |
| public ContentHandler | Returns: The current content handler, or null if none was supplied.Implements org. Return the current content handler. |
| public DTDHandler | Returns: the current DTD handler, or null if none was suppliedImplements org. Return the current DTD handler. |
| public EntityResolver | Returns: The current entity resolver, or null if none was supplied.Implements org. Return the current entity resolver. |
| public ErrorHandler | Returns: The current error handler, or null if none was supplied.Implements org. Return the current error handler. |
| public boolean | Returns: The current feature value.The feature name, as a complete URI. name)Implements org. Check a parser feature flag. |
| public Object | Returns: The property value.The property name. name)Implements org. Get a parser property. |
| public void | ignorableWhitespace(char[]
An array of characters. ch, int The starting position in the array. start, int The number of characters to use. length)Implements org. Adapter implementation method; do not call. |
| private SAXParseException | |
| public void | parse(String
The absolute URL of the document. systemId)Implements org. Parse an XML document. |
| public void | parse(InputSource
An input source for the document. input)Implements org. Parse an XML document. |
| public void | processingInstruction(String
The processing instruction target. target, String The remainder of the processing instruction data)Implements org. Adapter implementation method; do not call. |
| private String[] | Returns: The name split into three parts.The qualified (prefixed) name. qName, boolean true if this is an attribute name. isAttribute, boolean useException)Process a qualified (prefixed) name. |
| pack-priv void | |
| public void | setContentHandler(ContentHandler
the new content handler handler)Implements org. Set the content handler. |
| public void | setDocumentLocator(Locator
A document locator. locator)Implements org. Adapter implementation method; do not call. |
| public void | setDTDHandler(DTDHandler
the new DTD handler handler)Implements org. Set the DTD handler. |
| public void | setEntityResolver(EntityResolver
The new entity resolver. resolver)Implements org. Set the entity resolver. |
| public void | setErrorHandler(ErrorHandler
The new error handler. handler)Implements org. Set the error handler. |
| public void | setFeature(String
The feature name, as a complete URI. name, boolean The requested feature value. value)Implements org. Set a feature flag for the parser. |
| public void | setProperty(String
The property name. name, Object The property value. value)Implements org. Set a parser property. |
| private void | |
| private void | |
| public void | startDocument()
Implements org. Adapter implementation method; do not call. |
| public void | startElement(String
The qualified (prefixed) name. qName, AttributeList The XML attribute list (with qnames). qAtts)Implements org.
References Deprecated
AttributeList is deprecated or references (maybe indirectly) at least one deprecated element.
Adapter implementation method; do not call. |
| attAdapter | back to summary |
|---|---|
| private ParserAdapter. | |
| atts | back to summary |
|---|---|
| private AttributesImpl atts | |
| contentHandler | back to summary |
|---|---|
| pack-priv ContentHandler contentHandler | |
| dtdHandler | back to summary |
|---|---|
| pack-priv DTDHandler dtdHandler | |
| entityResolver | back to summary |
|---|---|
| pack-priv EntityResolver entityResolver | |
| errorHandler | back to summary |
|---|---|
| pack-priv ErrorHandler errorHandler | |
| FEATURES | back to summary |
|---|---|
| private static final String FEATURES | |
| locator | back to summary |
|---|---|
| pack-priv Locator locator | |
| nameParts | back to summary |
|---|---|
| private String[] nameParts | |
| NAMESPACE_PREFIXES | back to summary |
|---|---|
| private static final String NAMESPACE_PREFIXES | |
| NAMESPACES | back to summary |
|---|---|
| private static final String NAMESPACES | |
| namespaces | back to summary |
|---|---|
| private boolean namespaces | |
| nsSupport | back to summary |
|---|---|
| private NamespaceSupport nsSupport | |
| parser | back to summary |
|---|---|
| private Parser parser
References Deprecated
See corresponding docs for further information. | |
| parsing | back to summary |
|---|---|
| private boolean parsing | |
| prefixes | back to summary |
|---|---|
| private boolean prefixes | |
| uris | back to summary |
|---|---|
| private boolean uris | |
| XMLNS_URIs | back to summary |
|---|---|
| private static final String XMLNS_URIs | |
| ParserAdapter | back to summary |
|---|---|
| public ParserAdapter() throws SAXException Construct a new parser adapter. Use the "org.xml.sax.parser" property to locate the embedded SAX1 driver.
| |
| ParserAdapter | back to summary |
|---|---|
| public ParserAdapter(Parser parser)
References Deprecated
See corresponding docs for further information. Construct a new parser adapter. Note that the embedded parser cannot be changed once the adapter is created; to embed a different parser, allocate a new ParserAdapter.
| |
| characters | back to summary |
|---|---|
| public void characters(char[] ch, int start, int length) throws SAXException Implements org. Adapter implementation method; do not call. Adapt a SAX1 characters event.
| |
| checkNotParsing | back to summary |
|---|---|
| private void checkNotParsing(String type, String name) throws SAXNotSupportedException Throw an exception if we are parsing. Use this method to detect illegal feature or property changes.
| |
| endDocument | back to summary |
|---|---|
| public void endDocument() throws SAXException Implements org. Adapter implementation method; do not call. Adapt a SAX1 end document event.
| |
| endElement | back to summary |
|---|---|
| public void endElement(String qName) throws SAXException Implements org. Adapter implementation method; do not call. Adapt a SAX1 end element event.
| |
| getContentHandler | back to summary |
|---|---|
| public ContentHandler getContentHandler() Implements org. Return the current content handler.
| |
| getDTDHandler | back to summary |
|---|---|
| public DTDHandler getDTDHandler() Implements org. Return the current DTD handler.
| |
| getEntityResolver | back to summary |
|---|---|
| public EntityResolver getEntityResolver() Implements org. Return the current entity resolver.
| |
| getErrorHandler | back to summary |
|---|---|
| public ErrorHandler getErrorHandler() Implements org. Return the current error handler.
| |
| getFeature | back to summary |
|---|---|
| public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException Implements org. Check a parser feature flag. The only features recognized are namespaces and namespace-prefixes.
| |
| getProperty | back to summary |
|---|---|
| public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException Implements org. Get a parser property. No properties are currently recognized.
| |
| ignorableWhitespace | back to summary |
|---|---|
| public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException Implements org. Adapter implementation method; do not call. Adapt a SAX1 ignorable whitespace event.
| |
| makeException | back to summary |
|---|---|
| private SAXParseException makeException(String message) Construct an exception for the current context.
| |
| parse | back to summary |
|---|---|
| public void parse(String systemId) throws IOException, SAXException Implements org. Parse an XML document.
| |
| parse | back to summary |
|---|---|
| public void parse(InputSource input) throws IOException, SAXException Implements org. Parse an XML document.
| |
| processingInstruction | back to summary |
|---|---|
| public void processingInstruction(String target, String data) throws SAXException Implements org. Adapter implementation method; do not call. Adapt a SAX1 processing instruction event.
| |
| processName | back to summary |
|---|---|
| private String[] processName(String qName, boolean isAttribute, boolean useException) throws SAXException Process a qualified (prefixed) name. If the name has an undeclared prefix, use only the qname and make an ErrorHandler.error callback in case the app is interested.
| |
| reportError | back to summary |
|---|---|
| pack-priv void reportError(String message) throws SAXException Report a non-fatal error.
| |
| setContentHandler | back to summary |
|---|---|
| public void setContentHandler(ContentHandler handler) Implements org. Set the content handler.
| |
| setDocumentLocator | back to summary |
|---|---|
| public void setDocumentLocator(Locator locator) Implements org. Adapter implementation method; do not call. Adapt a SAX1 document locator event.
| |
| setDTDHandler | back to summary |
|---|---|
| public void setDTDHandler(DTDHandler handler) Implements org. Set the DTD handler.
| |
| setEntityResolver | back to summary |
|---|---|
| public void setEntityResolver(EntityResolver resolver) Implements org. Set the entity resolver.
| |
| setErrorHandler | back to summary |
|---|---|
| public void setErrorHandler(ErrorHandler handler) Implements org. Set the error handler.
| |
| setFeature | back to summary |
|---|---|
| public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException Implements org. Set a feature flag for the parser. The only features recognized are namespaces and namespace-prefixes.
| |
| setProperty | back to summary |
|---|---|
| public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException Implements org. Set a parser property. No properties are currently recognized.
| |
| setup | back to summary |
|---|---|
| private void setup(Parser parser)
References Deprecated
See corresponding docs for further information. Internal setup method.
| |
| setupParser | back to summary |
|---|---|
| private void setupParser() Initialize the parser before each run. | |
| startDocument | back to summary |
|---|---|
| public void startDocument() throws SAXException Implements org. Adapter implementation method; do not call. Adapt a SAX1 start document event.
| |
| startElement | back to summary |
|---|---|
| public void startElement(String qName, AttributeList qAtts) throws SAXException Implements org. References Deprecated
See corresponding docs for further information. Adapter implementation method; do not call. Adapt a SAX1 startElement event. If necessary, perform Namespace processing.
| |
This class is in the Public Domain, and comes with NO WARRANTY of any kind.
This wrapper class is used only when Namespace support is disabled -- it provides pretty much a direct mapping from SAX1 to SAX2, except that names and types are interned whenever requested.
| Modifier and Type | Field and Description |
|---|---|
| private AttributeList | qAtts
References Deprecated
AttributeList is deprecated or references (maybe indirectly) at least one deprecated element.
|
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: The attributes index, or -1 if none was found.The Namespace URI or the empty string. uri, String The local name. localName)Implements org. Look up an attribute index by Namespace name. |
| public int | Returns: The attributes index, or -1 if none was found.The qualified name. qName)Implements org. Look up an attribute index by qualified (prefixed) name. |
| public int | Returns: The number of attributes in the list.Implements org. Return the length of the attribute list. |
| public String | Returns: Always the empty string.Implements org. Return the local name of the specified attribute. |
| public String | Returns: The attribute's qualified name, internalized.Implements org. Return the qualified (prefixed) name of the specified attribute. |
| public String | Returns: The attribute's type as an internalized string.Implements org. Return the type of the specified attribute. |
| public String | Returns: The attribute's type as an internalized string.The Namespace URI uri, String The local name. localName)Implements org. Look up the type of an attribute by Namespace name. |
| public String | Returns: The attribute's type as an internalized string.The qualified name. qName)Implements org. Look up the type of an attribute by qualified (prefixed) name. |
| public String | Returns: Always the empty string.Implements org. Return the Namespace URI of the specified attribute. |
| public String | Returns: The attribute's value.Implements org. Return the value of the specified attribute. |
| public String | Returns: The attribute's value.The Namespace URI uri, String The local name. localName)Implements org. Look up the value of an attribute by Namespace name. |
| public String | Returns: The attribute's value.The qualified name. qName)Implements org. Look up the value of an attribute by qualified (prefixed) name. |
| pack-priv void | setAttributeList(AttributeList qAtts)
References Deprecated
AttributeList is deprecated or references (maybe indirectly) at least one deprecated element.
Set the embedded AttributeList. |
| qAtts | back to summary |
|---|---|
| private AttributeList qAtts
References Deprecated
See corresponding docs for further information. | |
| AttributeListAdapter | back to summary |
|---|---|
| pack-priv AttributeListAdapter() Construct a new adapter. | |
| getIndex | back to summary |
|---|---|
| public int getIndex(String uri, String localName) Implements org. Look up an attribute index by Namespace name.
| |
| getIndex | back to summary |
|---|---|
| public int getIndex(String qName) Implements org. Look up an attribute index by qualified (prefixed) name.
| |
| getLength | back to summary |
|---|---|
| public int getLength() Implements org. Return the length of the attribute list.
| |
| getLocalName | back to summary |
|---|---|
| public String getLocalName(int i) Implements org. Return the local name of the specified attribute.
| |
| getQName | back to summary |
|---|---|
| public String getQName(int i) Implements org. Return the qualified (prefixed) name of the specified attribute.
| |
| getType | back to summary |
|---|---|
| public String getType(int i) Implements org. Return the type of the specified attribute.
| |
| getType | back to summary |
|---|---|
| public String getType(String uri, String localName) Implements org. Look up the type of an attribute by Namespace name. | |
| getType | back to summary |
|---|---|
| public String getType(String qName) Implements org. Look up the type of an attribute by qualified (prefixed) name. | |
| getURI | back to summary |
|---|---|
| public String getURI(int i) Implements org. Return the Namespace URI of the specified attribute.
| |
| getValue | back to summary |
|---|---|
| public String getValue(int i) Implements org. Return the value of the specified attribute.
| |
| getValue | back to summary |
|---|---|
| public String getValue(String uri, String localName) Implements org. Look up the value of an attribute by Namespace name. | |
| getValue | back to summary |
|---|---|
| public String getValue(String qName) Implements org. Look up the value of an attribute by qualified (prefixed) name. | |
| setAttributeList | back to summary |
|---|---|
| pack-priv void setAttributeList(AttributeList qAtts)
References Deprecated
See corresponding docs for further information. Set the embedded AttributeList. This method must be invoked before any of the others can be used. | |