Package com.fasterxml.aalto.sax
Class SAXParserImpl
java.lang.Object
javax.xml.parsers.SAXParser
com.fasterxml.aalto.sax.SAXParserImpl
- All Implemented Interfaces:
Attributes
,Attributes2
,Locator2
,Locator
,Parser
,XMLReader
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
(package private) static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AttributeCollector
private int
protected ContentHandler
private DeclHandler
protected DTDHandler
private EntityResolver
private ErrorHandler
private LexicalHandler
protected XmlScanner
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.(package private) final InputFactoryImpl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate final void
fireAuxEvent
(int type, boolean inTree) private final void
private final void
This is the actual "tight event loop" that will send all events between start and end document events.private final void
int
boolean
getFeature
(String name) int
int
int
int
getLocalName
(int index) final Parser
getProperty
(String name) getQName
(int index) getType
(int index) getURI
(int index) getValue
(int index) final XMLReader
boolean
isDeclared
(int index) boolean
isDeclared
(String qName) boolean
isDeclared
(String uri, String localName) boolean
boolean
isSpecified
(int index) boolean
isSpecified
(String qName) boolean
isSpecified
(String uri, String localName) boolean
void
void
parse
(InputSource input) void
parse
(InputSource is, HandlerBase hb) void
parse
(InputSource is, DefaultHandler dh) void
setContentHandler
(ContentHandler handler) void
setDocumentHandler
(DocumentHandler handler) void
setDTDHandler
(DTDHandler handler) void
setEntityResolver
(EntityResolver resolver) void
setErrorHandler
(ErrorHandler handler) void
setFeature
(String name, boolean value) void
void
setProperty
(String name, Object value) private void
private void
throwSaxException
(String msg)
-
Field Details
-
_staxFactory
-
_scanner
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. In effect, this class is then a replacement of StreamReaderImpl, when using SAX interfaces. -
_attrCollector
-
_contentHandler
-
_dtdHandler
-
_entityResolver
-
_errorHandler
-
_lexicalHandler
-
_declHandler
-
_attrCount
private int _attrCount
-
-
Constructor Details
-
SAXParserImpl
SAXParserImpl(InputFactoryImpl sf)
-
-
Method Details
-
getParser
-
getXMLReader
- Specified by:
getXMLReader
in classSAXParser
-
isNamespaceAware
public boolean isNamespaceAware()- Specified by:
isNamespaceAware
in classSAXParser
-
isValidating
public boolean isValidating()- Specified by:
isValidating
in classSAXParser
-
getProperty
- Specified by:
getProperty
in interfaceXMLReader
- Specified by:
getProperty
in classSAXParser
- Throws:
SAXNotRecognizedException
SAXNotSupportedException
-
setProperty
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException - Specified by:
setProperty
in interfaceXMLReader
- Specified by:
setProperty
in classSAXParser
- Throws:
SAXNotRecognizedException
SAXNotSupportedException
-
parse
- Overrides:
parse
in classSAXParser
- Throws:
SAXException
IOException
-
parse
- Overrides:
parse
in classSAXParser
- Throws:
SAXException
IOException
-
getContentHandler
- Specified by:
getContentHandler
in interfaceXMLReader
-
getDTDHandler
- Specified by:
getDTDHandler
in interfaceXMLReader
-
getEntityResolver
- Specified by:
getEntityResolver
in interfaceXMLReader
-
getErrorHandler
- Specified by:
getErrorHandler
in interfaceXMLReader
-
getFeature
- Specified by:
getFeature
in interfaceXMLReader
- Throws:
SAXNotRecognizedException
-
setContentHandler
- Specified by:
setContentHandler
in interfaceXMLReader
-
setDTDHandler
- Specified by:
setDTDHandler
in interfaceParser
- Specified by:
setDTDHandler
in interfaceXMLReader
-
setEntityResolver
- Specified by:
setEntityResolver
in interfaceParser
- Specified by:
setEntityResolver
in interfaceXMLReader
-
setErrorHandler
- Specified by:
setErrorHandler
in interfaceParser
- Specified by:
setErrorHandler
in interfaceXMLReader
-
setFeature
- Specified by:
setFeature
in interfaceXMLReader
- Throws:
SAXNotRecognizedException
-
parse
- Specified by:
parse
in interfaceParser
- Specified by:
parse
in interfaceXMLReader
- Throws:
SAXException
-
parse
- Specified by:
parse
in interfaceParser
- Specified by:
parse
in interfaceXMLReader
- Throws:
SAXException
-
fireEvents
This is the actual "tight event loop" that will send all events between start and end document events. Although we could use the stream reader here, there's not much as it mostly just forwards requests to the scanner: and so we can as well just copy the little code stream reader's next() method has.- Throws:
SAXException
XMLStreamException
-
fireAuxEvent
- Throws:
SAXException
XMLStreamException
-
fireStartTag
- Throws:
SAXException
-
fireEndTag
- Throws:
SAXException
-
setDocumentHandler
- Specified by:
setDocumentHandler
in interfaceParser
-
setLocale
-
getIndex
- Specified by:
getIndex
in interfaceAttributes
-
getIndex
- Specified by:
getIndex
in interfaceAttributes
-
getLength
public int getLength()- Specified by:
getLength
in interfaceAttributes
-
getLocalName
- Specified by:
getLocalName
in interfaceAttributes
-
getQName
- Specified by:
getQName
in interfaceAttributes
-
getType
- Specified by:
getType
in interfaceAttributes
-
getType
- Specified by:
getType
in interfaceAttributes
-
getType
- Specified by:
getType
in interfaceAttributes
-
getURI
- Specified by:
getURI
in interfaceAttributes
-
getValue
- Specified by:
getValue
in interfaceAttributes
-
getValue
- Specified by:
getValue
in interfaceAttributes
-
getValue
- Specified by:
getValue
in interfaceAttributes
-
isDeclared
public boolean isDeclared(int index) - Specified by:
isDeclared
in interfaceAttributes2
-
isDeclared
- Specified by:
isDeclared
in interfaceAttributes2
-
isDeclared
- Specified by:
isDeclared
in interfaceAttributes2
-
isSpecified
public boolean isSpecified(int index) - Specified by:
isSpecified
in interfaceAttributes2
-
isSpecified
- Specified by:
isSpecified
in interfaceAttributes2
-
isSpecified
- Specified by:
isSpecified
in interfaceAttributes2
-
getColumnNumber
public int getColumnNumber()- Specified by:
getColumnNumber
in interfaceLocator
-
getLineNumber
public int getLineNumber()- Specified by:
getLineNumber
in interfaceLocator
-
getPublicId
- Specified by:
getPublicId
in interfaceLocator
-
getSystemId
- Specified by:
getSystemId
in interfaceLocator
-
getEncoding
- Specified by:
getEncoding
in interfaceLocator2
-
getXMLVersion
- Specified by:
getXMLVersion
in interfaceLocator2
-
throwSaxException
- Throws:
SAXException
-
throwSaxException
- Throws:
SAXException
-