Class SAXDocumentParser
- All Implemented Interfaces:
FastInfosetParser
,FastInfosetReader
,XMLReader
Instantiate this parser to parse a fast infoset document in accordance with the SAX API.
More than one fast infoset document may be decoded from the
InputStream
.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.sun.xml.fastinfoset.Decoder
Decoder.EncodingAlgorithmInputStream
-
Field Summary
Modifier and TypeFieldDescriptionprotected EncodingAlgorithmContentHandler
protected AttributesHolder
protected boolean
protected ContentHandler
Reference to content handler.protected DeclHandler
Reference to DTD declaration handler.protected DTDHandler
Reference to dtd handler.protected EntityResolver
Reference to entity resolver.protected ErrorHandler
Reference to error handler.protected LexicalHandler
Reference to lexical handler.protected int[]
protected boolean
SAX Namespace attributes featuresprotected int
protected PrimitiveTypeContentHandler
protected BuiltInEncodingAlgorithmState
Fields inherited from class com.sun.xml.fastinfoset.Decoder
_addToTable, _attributeNameTable, _attributeValueTable, _b, _bufferSize, _characterContentChunkTable, _charBuffer, _charBufferLength, _doubleTerminate, _duplicateAttributeVerifier, _elementNameTable, _identifier, _integer, _namespaceNameIndex, _needForceStreamClose, _notations, _octetBuffer, _octetBufferEnd, _octetBufferLength, _octetBufferOffset, _octetBufferStart, _parseFragments, _prefixIndex, _prefixTable, _registeredEncodingAlgorithms, _terminate, _unparsedEntities, _v, BUFFER_SIZE_SYSTEM_PROPERTY, NISTRING_EMPTY_STRING, NISTRING_ENCODING_ALGORITHM, NISTRING_INDEX, NISTRING_STRING, STRING_INTERNING_SYSTEM_PROPERTY
Fields inherited from interface org.jvnet.fastinfoset.FastInfosetParser
BUFFER_SIZE_PROPERTY, EXTERNAL_VOCABULARIES_PROPERTY, FORCE_STREAM_CLOSE_PROPERTY, REGISTERED_ENCODING_ALGORITHMS_PROPERTY, STRING_INTERNING_PROPERTY
Fields inherited from interface org.jvnet.fastinfoset.sax.FastInfosetReader
ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY, PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn the current DTD declaration handler.Return the current encoding algorithm handler.boolean
getFeature
(String name) Return the current lexical handler.Return the current primitive type handler.getProperty
(String name) final void
parse()
final void
parse
(InputStream s) Parse a fast infoset document from an InputStream.void
void
parse
(InputSource input) protected final void
processAIIEncodingAlgorithm
(QualifiedName name, boolean addToTable) protected final void
protected final void
protected final Object
protected final void
protected final void
processCIIEncodingAlgorithm
(boolean addToTable) protected final void
protected final void
protected final void
protected final void
protected final void
processEII
(QualifiedName name, boolean hasAttributes) protected final void
protected final void
protected void
void
setContentHandler
(ContentHandler handler) void
setDeclHandler
(DeclHandler handler) Allow an application to register a DTD declaration handler.void
setDTDHandler
(DTDHandler handler) void
Allow an application to register an encoding algorithm handler.void
setEntityResolver
(EntityResolver resolver) void
setErrorHandler
(ErrorHandler handler) void
setFeature
(String name, boolean value) void
setLexicalHandler
(LexicalHandler handler) Allow an application to register a lexical handler.void
Allow an application to register a primitive type handler.void
setProperty
(String name, Object value) Methods inherited from class com.sun.xml.fastinfoset.Decoder
_isFastInfosetDocument, closeIfRequired, createQualifiedNameString, createQualifiedNameString, decodeAdditionalData, decodeAlphabetOctetsAsCharBuffer, decodeCharacterEncodingScheme, decodeDII, decodeEIIIndexLarge, decodeEIIIndexMedium, decodeFourBitAlphabetOctetsAsCharBuffer, decodeHeader, decodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceName, decodeIdentifyingNonEmptyStringIndexOnFirstBitAsPrefix, decodeIdentifyingNonEmptyStringOnFirstBit, decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName, decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix, decodeInitialVocabulary, decodeIntegerIndexOnSecondBit, decodeLiteralQualifiedName, decodeNonEmptyOctetStringLengthOnSecondBit, decodeNonEmptyOctetStringOnSecondBitAsUtf8CharArray, decodeNonEmptyOctetStringOnSecondBitAsUtf8String, decodeNonIdentifyingStringOnFirstBit, decodeNotations, decodeOctetsOnFifthBitOfNonIdentifyingStringOnFirstBit, decodeOctetsOnSeventhBitOfNonIdentifyingStringOnThirdBit, decodeRAOctetsAsString, decodeRestrictedAlphabetAsCharBuffer, decodeRestrictedAlphabetAsString, decodeUnparsedEntities, decodeUtf16StringAsCharBuffer, decodeUtf16StringAsString, decodeUtf8NCNameIntoCharBuffer, decodeUtf8StringAsCharBuffer, decodeUtf8StringAsCharBuffer, decodeUtf8StringAsString, decodeUtf8StringIntoCharBuffer, decodeUtf8StringIntoCharBuffer, decodeVersion, getBufferSize, getExternalVocabularies, getForceStreamClose, getParseFragments, getRegisteredEncodingAlgorithms, getStringInterning, isFastInfosetDocument, peek, peek, peek2, read, reset, setBufferSize, setExternalVocabularies, setForceStreamClose, setInputStream, setParseFragments, setRegisteredEncodingAlgorithms, setStringInterning, setVocabulary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jvnet.fastinfoset.FastInfosetParser
getBufferSize, getExternalVocabularies, getForceStreamClose, getParseFragments, getRegisteredEncodingAlgorithms, getStringInterning, setBufferSize, setExternalVocabularies, setForceStreamClose, setParseFragments, setRegisteredEncodingAlgorithms, setStringInterning
-
Field Details
-
_namespacePrefixesFeature
protected boolean _namespacePrefixesFeatureSAX Namespace attributes features -
_entityResolver
Reference to entity resolver. -
_dtdHandler
Reference to dtd handler. -
_contentHandler
Reference to content handler. -
_errorHandler
Reference to error handler. -
_lexicalHandler
Reference to lexical handler. -
_declHandler
Reference to DTD declaration handler. -
_algorithmHandler
-
_primitiveHandler
-
builtInAlgorithmState
-
_attributes
-
_namespacePrefixes
protected int[] _namespacePrefixes -
_namespacePrefixesIndex
protected int _namespacePrefixesIndex -
_clearAttributes
protected boolean _clearAttributes
-
-
Constructor Details
-
SAXDocumentParser
public SAXDocumentParser()Creates a new instance of DocumetParser2
-
-
Method Details
-
resetOnError
protected void resetOnError() -
getFeature
- Specified by:
getFeature
in interfaceXMLReader
- Throws:
SAXNotRecognizedException
SAXNotSupportedException
-
setFeature
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException - Specified by:
setFeature
in interfaceXMLReader
- Throws:
SAXNotRecognizedException
SAXNotSupportedException
-
getProperty
- Specified by:
getProperty
in interfaceXMLReader
- Throws:
SAXNotRecognizedException
SAXNotSupportedException
-
setProperty
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException - Specified by:
setProperty
in interfaceXMLReader
- Throws:
SAXNotRecognizedException
SAXNotSupportedException
-
setEntityResolver
- Specified by:
setEntityResolver
in interfaceXMLReader
-
getEntityResolver
- Specified by:
getEntityResolver
in interfaceXMLReader
-
setDTDHandler
- Specified by:
setDTDHandler
in interfaceXMLReader
-
getDTDHandler
- Specified by:
getDTDHandler
in interfaceXMLReader
-
setContentHandler
- Specified by:
setContentHandler
in interfaceXMLReader
-
getContentHandler
- Specified by:
getContentHandler
in interfaceXMLReader
-
setErrorHandler
- Specified by:
setErrorHandler
in interfaceXMLReader
-
getErrorHandler
- Specified by:
getErrorHandler
in interfaceXMLReader
-
parse
- Specified by:
parse
in interfaceXMLReader
- Throws:
IOException
SAXException
-
parse
- Specified by:
parse
in interfaceXMLReader
- Throws:
IOException
SAXException
-
parse
Description copied from interface:FastInfosetReader
Parse a fast infoset document from an InputStream.The application can use this method to instruct the Fast Infoset reader to begin parsing a fast infoset document from a byte stream.
Applications may not invoke this method while a parse is in progress (they should create a new XMLReader instead for each nested XML document). Once a parse is complete, an application may reuse the same FastInfosetReader object, possibly with a different byte stream.
During the parse, the FastInfosetReader will provide information about the fast infoset document through the registered event handlers.
This method is synchronous: it will not return until parsing has ended. If a client application wants to terminate parsing early, it should throw an exception.
- Specified by:
parse
in interfaceFastInfosetReader
- Parameters:
s
- The byte stream to parse from.- Throws:
IOException
FastInfosetException
SAXException
-
setLexicalHandler
Description copied from interface:FastInfosetReader
Allow an application to register a lexical handler.Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
- Specified by:
setLexicalHandler
in interfaceFastInfosetReader
- Parameters:
handler
- The lexical handler.- See Also:
-
getLexicalHandler
Description copied from interface:FastInfosetReader
Return the current lexical handler.- Specified by:
getLexicalHandler
in interfaceFastInfosetReader
- Returns:
- The current lexical handler, or null if none has been registered.
- See Also:
-
setDeclHandler
Description copied from interface:FastInfosetReader
Allow an application to register a DTD declaration handler.Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
- Specified by:
setDeclHandler
in interfaceFastInfosetReader
- Parameters:
handler
- The DTD declaration handler.- See Also:
-
getDeclHandler
Description copied from interface:FastInfosetReader
Return the current DTD declaration handler.- Specified by:
getDeclHandler
in interfaceFastInfosetReader
- Returns:
- The current DTD declaration handler, or null if none has been registered.
- See Also:
-
setEncodingAlgorithmContentHandler
Description copied from interface:FastInfosetReader
Allow an application to register an encoding algorithm handler.Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
- Specified by:
setEncodingAlgorithmContentHandler
in interfaceFastInfosetReader
- Parameters:
handler
- The encoding algorithm handler.- See Also:
-
getEncodingAlgorithmContentHandler
Description copied from interface:FastInfosetReader
Return the current encoding algorithm handler.- Specified by:
getEncodingAlgorithmContentHandler
in interfaceFastInfosetReader
- Returns:
- The current encoding algorithm handler, or null if none has been registered.
- See Also:
-
setPrimitiveTypeContentHandler
Description copied from interface:FastInfosetReader
Allow an application to register a primitive type handler.Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
- Specified by:
setPrimitiveTypeContentHandler
in interfaceFastInfosetReader
- Parameters:
handler
- The primitive type handler.- See Also:
-
getPrimitiveTypeContentHandler
Description copied from interface:FastInfosetReader
Return the current primitive type handler.- Specified by:
getPrimitiveTypeContentHandler
in interfaceFastInfosetReader
- Returns:
- The current primitive type handler, or null if none has been registered.
- See Also:
-
parse
- Throws:
FastInfosetException
IOException
-
processDII
- Throws:
FastInfosetException
IOException
-
processDIIFragment
- Throws:
FastInfosetException
IOException
-
processDIIOptionalProperties
- Throws:
FastInfosetException
IOException
-
processEII
protected final void processEII(QualifiedName name, boolean hasAttributes) throws FastInfosetException, IOException - Throws:
FastInfosetException
IOException
-
processEIIWithNamespaces
- Throws:
FastInfosetException
IOException
-
processAIIs
- Throws:
FastInfosetException
IOException
-
processCommentII
- Throws:
FastInfosetException
IOException
-
processProcessingII
- Throws:
FastInfosetException
IOException
-
processCIIEncodingAlgorithm
protected final void processCIIEncodingAlgorithm(boolean addToTable) throws FastInfosetException, IOException - Throws:
FastInfosetException
IOException
-
processCIIBuiltInEncodingAlgorithmAsPrimitive
protected final void processCIIBuiltInEncodingAlgorithmAsPrimitive() throws FastInfosetException, IOException- Throws:
FastInfosetException
IOException
-
processAIIEncodingAlgorithm
protected final void processAIIEncodingAlgorithm(QualifiedName name, boolean addToTable) throws FastInfosetException, IOException - Throws:
FastInfosetException
IOException
-
processBuiltInEncodingAlgorithmAsCharacters
protected final void processBuiltInEncodingAlgorithmAsCharacters(StringBuffer buffer) throws FastInfosetException, IOException - Throws:
FastInfosetException
IOException
-
processBuiltInEncodingAlgorithmAsObject
protected final Object processBuiltInEncodingAlgorithmAsObject() throws FastInfosetException, IOException- Throws:
FastInfosetException
IOException
-