abstract class AbstractStaxXMLReader extends AbstractXMLReader
XMLReader implementations that use StAX as a basis.AbstractXMLReader.setContentHandler(org.xml.sax.ContentHandler),
AbstractXMLReader.setDTDHandler(org.xml.sax.DTDHandler),
AbstractXMLReader.setEntityResolver(org.xml.sax.EntityResolver),
AbstractXMLReader.setErrorHandler(org.xml.sax.ErrorHandler)| Modifier and Type | Class and Description |
|---|---|
private static class |
AbstractStaxXMLReader.StaxLocator
Implementation of the
Locator interface based on a given StAX Location. |
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
IS_STANDALONE_FEATURE_NAME |
private java.lang.Boolean |
isStandalone |
private static java.lang.String |
NAMESPACE_PREFIXES_FEATURE_NAME |
private boolean |
namespacePrefixesFeature |
private java.util.Map<java.lang.String,java.lang.String> |
namespaces |
private static java.lang.String |
NAMESPACES_FEATURE_NAME |
private boolean |
namespacesFeature |
| Constructor and Description |
|---|
AbstractStaxXMLReader() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
endPrefixMapping(java.lang.String prefix)
End the prefix mapping for the given prefix.
|
boolean |
getFeature(java.lang.String name)
This implementation throws a
SAXNotRecognizedException exception
for any feature outside of the "http://xml.org/sax/features/" namespace
and returns false for any feature within. |
protected boolean |
hasNamespacePrefixesFeature()
Indicates whether the SAX feature
http://xml.org/sax/features/namespaces-prefixes is turned on. |
protected boolean |
hasNamespacesFeature()
Indicates whether the SAX feature
http://xml.org/sax/features/namespaces is turned on. |
private void |
parse() |
void |
parse(org.xml.sax.InputSource ignored)
Parse the StAX XML reader passed at construction-time.
|
void |
parse(java.lang.String ignored)
Parse the StAX XML reader passed at construction-time.
|
protected abstract void |
parseInternal()
Template method that parses the StAX reader passed at construction-time.
|
void |
setFeature(java.lang.String name,
boolean value)
This implementation throws a
SAXNotRecognizedException exception
for any feature outside of the "http://xml.org/sax/features/" namespace
and accepts a false value for any feature within. |
protected void |
setStandalone(boolean standalone) |
protected void |
startPrefixMapping(java.lang.String prefix,
java.lang.String namespace)
Start the prefix mapping for the given prefix.
|
protected java.lang.String |
toQualifiedName(javax.xml.namespace.QName qName)
Convert a
QName to a qualified name, as used by DOM and SAX. |
getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getLexicalHandler, getProperty, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setPropertyprivate static final java.lang.String NAMESPACES_FEATURE_NAME
private static final java.lang.String NAMESPACE_PREFIXES_FEATURE_NAME
private static final java.lang.String IS_STANDALONE_FEATURE_NAME
private boolean namespacesFeature
private boolean namespacePrefixesFeature
@Nullable private java.lang.Boolean isStandalone
private final java.util.Map<java.lang.String,java.lang.String> namespaces
public boolean getFeature(java.lang.String name)
throws org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException
AbstractXMLReaderSAXNotRecognizedException exception
for any feature outside of the "http://xml.org/sax/features/" namespace
and returns false for any feature within.getFeature in interface org.xml.sax.XMLReadergetFeature in class AbstractXMLReaderorg.xml.sax.SAXNotRecognizedExceptionorg.xml.sax.SAXNotSupportedExceptionpublic void setFeature(java.lang.String name,
boolean value)
throws org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException
AbstractXMLReaderSAXNotRecognizedException exception
for any feature outside of the "http://xml.org/sax/features/" namespace
and accepts a false value for any feature within.setFeature in interface org.xml.sax.XMLReadersetFeature in class AbstractXMLReaderorg.xml.sax.SAXNotRecognizedExceptionorg.xml.sax.SAXNotSupportedExceptionprotected void setStandalone(boolean standalone)
protected boolean hasNamespacesFeature()
http://xml.org/sax/features/namespaces is turned on.protected boolean hasNamespacePrefixesFeature()
http://xml.org/sax/features/namespaces-prefixes is turned on.protected java.lang.String toQualifiedName(javax.xml.namespace.QName qName)
QName to a qualified name, as used by DOM and SAX.
The returned string has a format of prefix:localName if the
prefix is set, or just localName if not.qName - the QNamepublic final void parse(org.xml.sax.InputSource ignored)
throws org.xml.sax.SAXException
NOTE:: The given InputSource is not read, but ignored.
ignored - is ignoredorg.xml.sax.SAXException - a SAX exception, possibly wrapping a XMLStreamExceptionpublic final void parse(java.lang.String ignored)
throws org.xml.sax.SAXException
NOTE:: The given system identifier is not read, but ignored.
ignored - is ignoredorg.xml.sax.SAXException - a SAX exception, possibly wrapping a XMLStreamExceptionprivate void parse()
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionprotected abstract void parseInternal()
throws org.xml.sax.SAXException,
javax.xml.stream.XMLStreamException
org.xml.sax.SAXExceptionjavax.xml.stream.XMLStreamExceptionprotected void startPrefixMapping(@Nullable java.lang.String prefix, java.lang.String namespace) throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionContentHandler.startPrefixMapping(String, String)protected void endPrefixMapping(java.lang.String prefix)
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionContentHandler.endPrefixMapping(String)