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 AttributeCollectorprivate intprotected ContentHandlerprivate DeclHandlerprotected DTDHandlerprivate EntityResolverprivate ErrorHandlerprivate LexicalHandlerprotected XmlScannerSince 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 voidfireAuxEvent(int type, boolean inTree) private final voidprivate final voidThis is the actual "tight event loop" that will send all events between start and end document events.private final voidintbooleangetFeature(String name) intintintintgetLocalName(int index) final ParsergetProperty(String name) getQName(int index) getType(int index) getURI(int index) getValue(int index) final XMLReaderbooleanisDeclared(int index) booleanisDeclared(String qName) booleanisDeclared(String uri, String localName) booleanbooleanisSpecified(int index) booleanisSpecified(String qName) booleanisSpecified(String uri, String localName) booleanvoidvoidparse(InputSource input) voidparse(InputSource is, HandlerBase hb) voidparse(InputSource is, DefaultHandler dh) voidsetContentHandler(ContentHandler handler) voidsetDocumentHandler(DocumentHandler handler) voidsetDTDHandler(DTDHandler handler) voidsetEntityResolver(EntityResolver resolver) voidsetErrorHandler(ErrorHandler handler) voidsetFeature(String name, boolean value) voidvoidsetProperty(String name, Object value) private voidprivate voidthrowSaxException(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:
getXMLReaderin classSAXParser
-
isNamespaceAware
public boolean isNamespaceAware()- Specified by:
isNamespaceAwarein classSAXParser
-
isValidating
public boolean isValidating()- Specified by:
isValidatingin classSAXParser
-
getProperty
- Specified by:
getPropertyin interfaceXMLReader- Specified by:
getPropertyin classSAXParser- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
setProperty
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException - Specified by:
setPropertyin interfaceXMLReader- Specified by:
setPropertyin classSAXParser- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
parse
- Overrides:
parsein classSAXParser- Throws:
SAXExceptionIOException
-
parse
- Overrides:
parsein classSAXParser- Throws:
SAXExceptionIOException
-
getContentHandler
- Specified by:
getContentHandlerin interfaceXMLReader
-
getDTDHandler
- Specified by:
getDTDHandlerin interfaceXMLReader
-
getEntityResolver
- Specified by:
getEntityResolverin interfaceXMLReader
-
getErrorHandler
- Specified by:
getErrorHandlerin interfaceXMLReader
-
getFeature
- Specified by:
getFeaturein interfaceXMLReader- Throws:
SAXNotRecognizedException
-
setContentHandler
- Specified by:
setContentHandlerin interfaceXMLReader
-
setDTDHandler
- Specified by:
setDTDHandlerin interfaceParser- Specified by:
setDTDHandlerin interfaceXMLReader
-
setEntityResolver
- Specified by:
setEntityResolverin interfaceParser- Specified by:
setEntityResolverin interfaceXMLReader
-
setErrorHandler
- Specified by:
setErrorHandlerin interfaceParser- Specified by:
setErrorHandlerin interfaceXMLReader
-
setFeature
- Specified by:
setFeaturein interfaceXMLReader- Throws:
SAXNotRecognizedException
-
parse
- Specified by:
parsein interfaceParser- Specified by:
parsein interfaceXMLReader- Throws:
SAXException
-
parse
- Specified by:
parsein interfaceParser- Specified by:
parsein 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:
SAXExceptionXMLStreamException
-
fireAuxEvent
- Throws:
SAXExceptionXMLStreamException
-
fireStartTag
- Throws:
SAXException
-
fireEndTag
- Throws:
SAXException
-
setDocumentHandler
- Specified by:
setDocumentHandlerin interfaceParser
-
setLocale
-
getIndex
- Specified by:
getIndexin interfaceAttributes
-
getIndex
- Specified by:
getIndexin interfaceAttributes
-
getLength
public int getLength()- Specified by:
getLengthin interfaceAttributes
-
getLocalName
- Specified by:
getLocalNamein interfaceAttributes
-
getQName
- Specified by:
getQNamein interfaceAttributes
-
getType
- Specified by:
getTypein interfaceAttributes
-
getType
- Specified by:
getTypein interfaceAttributes
-
getType
- Specified by:
getTypein interfaceAttributes
-
getURI
- Specified by:
getURIin interfaceAttributes
-
getValue
- Specified by:
getValuein interfaceAttributes
-
getValue
- Specified by:
getValuein interfaceAttributes
-
getValue
- Specified by:
getValuein interfaceAttributes
-
isDeclared
public boolean isDeclared(int index) - Specified by:
isDeclaredin interfaceAttributes2
-
isDeclared
- Specified by:
isDeclaredin interfaceAttributes2
-
isDeclared
- Specified by:
isDeclaredin interfaceAttributes2
-
isSpecified
public boolean isSpecified(int index) - Specified by:
isSpecifiedin interfaceAttributes2
-
isSpecified
- Specified by:
isSpecifiedin interfaceAttributes2
-
isSpecified
- Specified by:
isSpecifiedin interfaceAttributes2
-
getColumnNumber
public int getColumnNumber()- Specified by:
getColumnNumberin interfaceLocator
-
getLineNumber
public int getLineNumber()- Specified by:
getLineNumberin interfaceLocator
-
getPublicId
- Specified by:
getPublicIdin interfaceLocator
-
getSystemId
- Specified by:
getSystemIdin interfaceLocator
-
getEncoding
- Specified by:
getEncodingin interfaceLocator2
-
getXMLVersion
- Specified by:
getXMLVersionin interfaceLocator2
-
throwSaxException
- Throws:
SAXException
-
throwSaxException
- Throws:
SAXException
-