|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.xml.parsers.SAXParser
com.ctc.wstx.sax.WstxSAXParser
public class WstxSAXParser
This class implements parser part of JAXP and SAX interfaces; and effectively offers an alternative to using Stax input factory / stream reader combination.
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
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 |
|
| Methods inherited from class javax.xml.parsers.SAXParser |
|---|
getSchema, isXIncludeAware, parse, parse, parse, parse, parse, parse, parse, parse, reset |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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).
| Constructor Detail |
|---|
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()
| Method Detail |
|---|
public final Parser getParser()
getParser in class SAXParserpublic final XMLReader getXMLReader()
getXMLReader in class SAXParserpublic final ReaderConfig getStaxConfig()
public boolean isNamespaceAware()
isNamespaceAware in class SAXParserpublic boolean isValidating()
isValidating in class SAXParser
public Object getProperty(String name)
throws SAXNotRecognizedException,
SAXNotSupportedException
getProperty in interface XMLReadergetProperty in class SAXParserSAXNotRecognizedException
SAXNotSupportedException
public void setProperty(String name,
Object value)
throws SAXNotRecognizedException,
SAXNotSupportedException
setProperty in interface XMLReadersetProperty in class SAXParserSAXNotRecognizedException
SAXNotSupportedException
public void parse(InputSource is,
HandlerBase hb)
throws SAXException,
IOException
parse in class SAXParserSAXException
IOException
public void parse(InputSource is,
org.xml.sax.helpers.DefaultHandler dh)
throws SAXException,
IOException
parse in class SAXParserSAXException
IOExceptionpublic ContentHandler getContentHandler()
getContentHandler in interface XMLReaderpublic DTDHandler getDTDHandler()
getDTDHandler in interface XMLReaderpublic EntityResolver getEntityResolver()
getEntityResolver in interface XMLReaderpublic ErrorHandler getErrorHandler()
getErrorHandler in interface XMLReader
public boolean getFeature(String name)
throws SAXNotRecognizedException
getFeature in interface XMLReaderSAXNotRecognizedExceptionpublic void setContentHandler(ContentHandler handler)
setContentHandler in interface XMLReaderpublic void setDTDHandler(DTDHandler handler)
setDTDHandler in interface ParsersetDTDHandler in interface XMLReaderpublic void setEntityResolver(EntityResolver resolver)
setEntityResolver in interface ParsersetEntityResolver in interface XMLReaderpublic void setErrorHandler(ErrorHandler handler)
setErrorHandler in interface ParsersetErrorHandler in interface XMLReader
public void setFeature(String name,
boolean value)
throws SAXNotRecognizedException,
SAXNotSupportedException
setFeature in interface XMLReaderSAXNotRecognizedException
SAXNotSupportedException
public void parse(InputSource input)
throws SAXException
parse in interface Parserparse in interface XMLReaderSAXException
public void parse(String systemId)
throws SAXException
parse in interface Parserparse in interface XMLReaderSAXExceptionpublic void setDocumentHandler(DocumentHandler handler)
setDocumentHandler in interface Parserpublic void setLocale(Locale locale)
setLocale in interface Parserpublic int getIndex(String qName)
getIndex in interface Attributes
public int getIndex(String uri,
String localName)
getIndex in interface Attributespublic int getLength()
getLength in interface Attributespublic String getLocalName(int index)
getLocalName in interface Attributespublic String getQName(int index)
getQName in interface Attributespublic String getType(int index)
getType in interface Attributespublic String getType(String qName)
getType in interface Attributes
public String getType(String uri,
String localName)
getType in interface Attributespublic String getURI(int index)
getURI in interface Attributespublic String getValue(int index)
getValue in interface Attributespublic String getValue(String qName)
getValue in interface Attributes
public String getValue(String uri,
String localName)
getValue in interface Attributespublic boolean isDeclared(int index)
isDeclared in interface Attributes2public boolean isDeclared(String qName)
isDeclared in interface Attributes2
public boolean isDeclared(String uri,
String localName)
isDeclared in interface Attributes2public boolean isSpecified(int index)
isSpecified in interface Attributes2public boolean isSpecified(String qName)
isSpecified in interface Attributes2
public boolean isSpecified(String uri,
String localName)
isSpecified in interface Attributes2public int getColumnNumber()
getColumnNumber in interface Locatorpublic int getLineNumber()
getLineNumber in interface Locatorpublic String getPublicId()
getPublicId in interface Locatorpublic String getSystemId()
getSystemId in interface Locatorpublic String getEncoding()
getEncoding in interface Locator2public String getXMLVersion()
getXMLVersion in interface Locator2public 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 DTDEventListenerpublic void dtdSkippedEntity(String name)
dtdSkippedEntity in interface DTDEventListener
public void dtdNotationDecl(String name,
String publicId,
String systemId,
URL baseURL)
throws XMLStreamException
dtdNotationDecl in interface DTDEventListenerXMLStreamException
public void dtdUnparsedEntityDecl(String name,
String publicId,
String systemId,
String notationName,
URL baseURL)
throws XMLStreamException
dtdUnparsedEntityDecl in interface DTDEventListenerXMLStreamException
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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||