public class WstxSAXParser extends SAXParser implements Parser, XMLReader, Attributes2, Locator2, DTDEventListener
Modifier and Type | Field and Description |
---|---|
protected AttributeCollector |
mAttrCollector |
protected int |
mAttrCount
Number of attributes accessible via
Attributes and
Attributes2 interfaces, for the current start element. |
protected ReaderConfig |
mConfig |
protected ContentHandler |
mContentHandler |
protected DTDHandler |
mDTDHandler |
protected InputElementStack |
mElemStack |
protected String |
mEncoding |
protected boolean |
mFeatNsPrefixes |
protected int |
mNsCount
Need to keep track of number of namespaces, if namespace declarations
are to be reported along with attributes (see
mFeatNsPrefixes ). |
protected BasicStreamReader |
mScanner
Since the stream reader would mostly be just a wrapper around
the underlying scanner (its main job is to implement Stax
interface), we can and should just use the scanner.
|
protected boolean |
mStandalone |
protected WstxInputFactory |
mStaxFactory
We will need the factory reference mostly for constructing
underlying stream reader we use.
|
protected String |
mXmlVersion |
Constructor and Description |
---|
WstxSAXParser() |
WstxSAXParser(WstxInputFactory sf,
boolean nsPrefixes)
NOTE: this was a protected constructor for versions 4.0
and 3.2; changed to public in 4.1
|
protected final WstxInputFactory mStaxFactory
protected final ReaderConfig mConfig
protected boolean mFeatNsPrefixes
protected BasicStreamReader mScanner
protected AttributeCollector mAttrCollector
protected InputElementStack mElemStack
protected String mEncoding
protected String mXmlVersion
protected boolean mStandalone
protected ContentHandler mContentHandler
protected DTDHandler mDTDHandler
protected int mAttrCount
Attributes
and
Attributes2
interfaces, for the current start element.
Note: does not include namespace declarations, even they are to be reported as attributes.
protected int mNsCount
mFeatNsPrefixes
).public WstxSAXParser(WstxInputFactory sf, boolean nsPrefixes)
NOTE: this was a protected constructor for versions 4.0 and 3.2; changed to public in 4.1
public WstxSAXParser()
public final XMLReader getXMLReader()
getXMLReader
in class SAXParser
public final ReaderConfig getStaxConfig()
public boolean isNamespaceAware()
isNamespaceAware
in class SAXParser
public boolean isValidating()
isValidating
in class SAXParser
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException
getProperty
in interface XMLReader
getProperty
in class SAXParser
SAXNotRecognizedException
SAXNotSupportedException
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException
setProperty
in interface XMLReader
setProperty
in class SAXParser
SAXNotRecognizedException
SAXNotSupportedException
public void parse(InputSource is, HandlerBase hb) throws SAXException, IOException
parse
in class SAXParser
SAXException
IOException
public void parse(InputSource is, DefaultHandler dh) throws SAXException, IOException
parse
in class SAXParser
SAXException
IOException
public ContentHandler getContentHandler()
getContentHandler
in interface XMLReader
public DTDHandler getDTDHandler()
getDTDHandler
in interface XMLReader
public EntityResolver getEntityResolver()
getEntityResolver
in interface XMLReader
public ErrorHandler getErrorHandler()
getErrorHandler
in interface XMLReader
public boolean getFeature(String name) throws SAXNotRecognizedException
getFeature
in interface XMLReader
SAXNotRecognizedException
public void setContentHandler(ContentHandler handler)
setContentHandler
in interface XMLReader
public void setDTDHandler(DTDHandler handler)
setDTDHandler
in interface Parser
setDTDHandler
in interface XMLReader
public void setEntityResolver(EntityResolver resolver)
setEntityResolver
in interface Parser
setEntityResolver
in interface XMLReader
public void setErrorHandler(ErrorHandler handler)
setErrorHandler
in interface Parser
setErrorHandler
in interface XMLReader
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException
setFeature
in interface XMLReader
SAXNotRecognizedException
SAXNotSupportedException
public void parse(InputSource input) throws SAXException
parse
in interface Parser
parse
in interface XMLReader
SAXException
public void parse(String systemId) throws SAXException
parse
in interface Parser
parse
in interface XMLReader
SAXException
public void setDocumentHandler(DocumentHandler handler)
setDocumentHandler
in interface Parser
public int getIndex(String qName)
getIndex
in interface Attributes
public int getIndex(String uri, String localName)
getIndex
in interface Attributes
public int getLength()
getLength
in interface Attributes
public String getLocalName(int index)
getLocalName
in interface Attributes
public String getQName(int index)
getQName
in interface Attributes
public String getType(int index)
getType
in interface Attributes
public String getType(String qName)
getType
in interface Attributes
public String getType(String uri, String localName)
getType
in interface Attributes
public String getURI(int index)
getURI
in interface Attributes
public String getValue(int index)
getValue
in interface Attributes
public String getValue(String qName)
getValue
in interface Attributes
public String getValue(String uri, String localName)
getValue
in interface Attributes
public boolean isDeclared(int index)
isDeclared
in interface Attributes2
public boolean isDeclared(String qName)
isDeclared
in interface Attributes2
public boolean isDeclared(String uri, String localName)
isDeclared
in interface Attributes2
public boolean isSpecified(int index)
isSpecified
in interface Attributes2
public boolean isSpecified(String qName)
isSpecified
in interface Attributes2
public boolean isSpecified(String uri, String localName)
isSpecified
in interface Attributes2
public int getColumnNumber()
getColumnNumber
in interface Locator
public int getLineNumber()
getLineNumber
in interface Locator
public String getPublicId()
getPublicId
in interface Locator
public String getSystemId()
getSystemId
in interface Locator
public String getEncoding()
getEncoding
in interface Locator2
public String getXMLVersion()
getXMLVersion
in interface Locator2
public boolean dtdReportComments()
dtdReportComments
in interface DTDEventListener
public void dtdComment(char[] data, int offset, int len)
dtdComment
in interface DTDEventListener
public void dtdProcessingInstruction(String target, String data)
dtdProcessingInstruction
in interface DTDEventListener
public void dtdSkippedEntity(String name)
dtdSkippedEntity
in interface DTDEventListener
public void dtdNotationDecl(String name, String publicId, String systemId, URL baseURL) throws XMLStreamException
dtdNotationDecl
in interface DTDEventListener
XMLStreamException
public void dtdUnparsedEntityDecl(String name, String publicId, String systemId, String notationName, URL baseURL) throws XMLStreamException
dtdUnparsedEntityDecl
in interface DTDEventListener
XMLStreamException
public void attributeDecl(String eName, String aName, String type, String mode, String value)
attributeDecl
in interface DTDEventListener
public void dtdElementDecl(String name, String model)
dtdElementDecl
in interface DTDEventListener
public void dtdExternalEntityDecl(String name, String publicId, String systemId)
dtdExternalEntityDecl
in interface DTDEventListener
public void dtdInternalEntityDecl(String name, String value)
dtdInternalEntityDecl
in interface DTDEventListener
Copyright © 2018 FasterXML. All rights reserved.