public class SAXDocumentParser extends Decoder implements FastInfosetReader
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
.
Decoder.EncodingAlgorithmInputStream
Modifier and Type | Field and Description |
---|---|
protected EncodingAlgorithmContentHandler |
_algorithmHandler |
protected AttributesHolder |
_attributes |
protected boolean |
_clearAttributes |
protected ContentHandler |
_contentHandler
Reference to content handler.
|
protected DeclHandler |
_declHandler
Reference to DTD declaration handler.
|
protected DTDHandler |
_dtdHandler
Reference to dtd handler.
|
protected EntityResolver |
_entityResolver
Reference to entity resolver.
|
protected ErrorHandler |
_errorHandler
Reference to error handler.
|
protected LexicalHandler |
_lexicalHandler
Reference to lexical handler.
|
protected int[] |
_namespacePrefixes |
protected boolean |
_namespacePrefixesFeature
SAX Namespace attributes features
|
protected int |
_namespacePrefixesIndex |
protected PrimitiveTypeContentHandler |
_primitiveHandler |
protected BuiltInEncodingAlgorithmState |
builtInAlgorithmState |
_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
ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY, PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY
BUFFER_SIZE_PROPERTY, EXTERNAL_VOCABULARIES_PROPERTY, FORCE_STREAM_CLOSE_PROPERTY, REGISTERED_ENCODING_ALGORITHMS_PROPERTY, STRING_INTERNING_PROPERTY
Constructor and Description |
---|
SAXDocumentParser()
Creates a new instance of DocumetParser2
|
Modifier and Type | Method and Description |
---|---|
ContentHandler |
getContentHandler() |
DeclHandler |
getDeclHandler()
Return the current DTD declaration handler.
|
DTDHandler |
getDTDHandler() |
EncodingAlgorithmContentHandler |
getEncodingAlgorithmContentHandler()
Return the current encoding algorithm handler.
|
EntityResolver |
getEntityResolver() |
ErrorHandler |
getErrorHandler() |
boolean |
getFeature(String name) |
LexicalHandler |
getLexicalHandler()
Return the current lexical handler.
|
PrimitiveTypeContentHandler |
getPrimitiveTypeContentHandler()
Return the current primitive type handler.
|
Object |
getProperty(String name) |
void |
parse() |
void |
parse(InputSource input) |
void |
parse(InputStream s)
Parse a fast infoset document from an InputStream.
|
void |
parse(String systemId) |
protected void |
processAIIEncodingAlgorithm(QualifiedName name,
boolean addToTable) |
protected void |
processAIIs() |
protected void |
processBuiltInEncodingAlgorithmAsCharacters(StringBuffer buffer) |
protected Object |
processBuiltInEncodingAlgorithmAsObject() |
protected void |
processCIIBuiltInEncodingAlgorithmAsPrimitive() |
protected void |
processCIIEncodingAlgorithm(boolean addToTable) |
protected void |
processCommentII() |
protected void |
processDII() |
protected void |
processDIIFragment() |
protected void |
processDIIOptionalProperties() |
protected void |
processEII(QualifiedName name,
boolean hasAttributes) |
protected void |
processEIIWithNamespaces() |
protected void |
processProcessingII() |
protected void |
resetOnError() |
void |
setContentHandler(ContentHandler handler) |
void |
setDeclHandler(DeclHandler handler)
Allow an application to register a DTD declaration handler.
|
void |
setDTDHandler(DTDHandler handler) |
void |
setEncodingAlgorithmContentHandler(EncodingAlgorithmContentHandler handler)
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 |
setPrimitiveTypeContentHandler(PrimitiveTypeContentHandler handler)
Allow an application to register a primitive type handler.
|
void |
setProperty(String name,
Object value) |
_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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBufferSize, getExternalVocabularies, getForceStreamClose, getParseFragments, getRegisteredEncodingAlgorithms, getStringInterning, setBufferSize, setExternalVocabularies, setForceStreamClose, setParseFragments, setRegisteredEncodingAlgorithms, setStringInterning
protected boolean _namespacePrefixesFeature
protected EntityResolver _entityResolver
protected DTDHandler _dtdHandler
protected ContentHandler _contentHandler
protected ErrorHandler _errorHandler
protected LexicalHandler _lexicalHandler
protected DeclHandler _declHandler
protected EncodingAlgorithmContentHandler _algorithmHandler
protected PrimitiveTypeContentHandler _primitiveHandler
protected BuiltInEncodingAlgorithmState builtInAlgorithmState
protected AttributesHolder _attributes
protected int[] _namespacePrefixes
protected int _namespacePrefixesIndex
protected boolean _clearAttributes
public SAXDocumentParser()
protected void resetOnError()
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException
getFeature
in interface XMLReader
SAXNotRecognizedException
SAXNotSupportedException
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException
setFeature
in interface XMLReader
SAXNotRecognizedException
SAXNotSupportedException
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException
getProperty
in interface XMLReader
SAXNotRecognizedException
SAXNotSupportedException
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException
setProperty
in interface XMLReader
SAXNotRecognizedException
SAXNotSupportedException
public void setEntityResolver(EntityResolver resolver)
setEntityResolver
in interface XMLReader
public EntityResolver getEntityResolver()
getEntityResolver
in interface XMLReader
public void setDTDHandler(DTDHandler handler)
setDTDHandler
in interface XMLReader
public DTDHandler getDTDHandler()
getDTDHandler
in interface XMLReader
public void setContentHandler(ContentHandler handler)
setContentHandler
in interface XMLReader
public ContentHandler getContentHandler()
getContentHandler
in interface XMLReader
public void setErrorHandler(ErrorHandler handler)
setErrorHandler
in interface XMLReader
public ErrorHandler getErrorHandler()
getErrorHandler
in interface XMLReader
public void parse(InputSource input) throws IOException, SAXException
parse
in interface XMLReader
IOException
SAXException
public void parse(String systemId) throws IOException, SAXException
parse
in interface XMLReader
IOException
SAXException
public final void parse(InputStream s) throws IOException, FastInfosetException, SAXException
FastInfosetReader
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.
parse
in interface FastInfosetReader
s
- The byte stream to parse from.IOException
FastInfosetException
SAXException
public void setLexicalHandler(LexicalHandler handler)
FastInfosetReader
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.
setLexicalHandler
in interface FastInfosetReader
handler
- The lexical handler.FastInfosetReader.getLexicalHandler()
public LexicalHandler getLexicalHandler()
FastInfosetReader
getLexicalHandler
in interface FastInfosetReader
FastInfosetReader.setLexicalHandler(org.xml.sax.ext.LexicalHandler)
public void setDeclHandler(DeclHandler handler)
FastInfosetReader
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.
setDeclHandler
in interface FastInfosetReader
handler
- The DTD declaration handler.FastInfosetReader.getLexicalHandler()
public DeclHandler getDeclHandler()
FastInfosetReader
getDeclHandler
in interface FastInfosetReader
FastInfosetReader.setLexicalHandler(org.xml.sax.ext.LexicalHandler)
public void setEncodingAlgorithmContentHandler(EncodingAlgorithmContentHandler handler)
FastInfosetReader
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.
setEncodingAlgorithmContentHandler
in interface FastInfosetReader
handler
- The encoding algorithm handler.FastInfosetReader.getEncodingAlgorithmContentHandler()
public EncodingAlgorithmContentHandler getEncodingAlgorithmContentHandler()
FastInfosetReader
getEncodingAlgorithmContentHandler
in interface FastInfosetReader
FastInfosetReader.setEncodingAlgorithmContentHandler(org.jvnet.fastinfoset.sax.EncodingAlgorithmContentHandler)
public void setPrimitiveTypeContentHandler(PrimitiveTypeContentHandler handler)
FastInfosetReader
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.
setPrimitiveTypeContentHandler
in interface FastInfosetReader
handler
- The primitive type handler.FastInfosetReader.getPrimitiveTypeContentHandler()
public PrimitiveTypeContentHandler getPrimitiveTypeContentHandler()
FastInfosetReader
getPrimitiveTypeContentHandler
in interface FastInfosetReader
FastInfosetReader.setPrimitiveTypeContentHandler(org.jvnet.fastinfoset.sax.PrimitiveTypeContentHandler)
public final void parse() throws FastInfosetException, IOException
FastInfosetException
IOException
protected final void processDII() throws FastInfosetException, IOException
FastInfosetException
IOException
protected final void processDIIFragment() throws FastInfosetException, IOException
FastInfosetException
IOException
protected final void processDIIOptionalProperties() throws FastInfosetException, IOException
FastInfosetException
IOException
protected final void processEII(QualifiedName name, boolean hasAttributes) throws FastInfosetException, IOException
FastInfosetException
IOException
protected final void processEIIWithNamespaces() throws FastInfosetException, IOException
FastInfosetException
IOException
protected final void processAIIs() throws FastInfosetException, IOException
FastInfosetException
IOException
protected final void processCommentII() throws FastInfosetException, IOException
FastInfosetException
IOException
protected final void processProcessingII() throws FastInfosetException, IOException
FastInfosetException
IOException
protected final void processCIIEncodingAlgorithm(boolean addToTable) throws FastInfosetException, IOException
FastInfosetException
IOException
protected final void processCIIBuiltInEncodingAlgorithmAsPrimitive() throws FastInfosetException, IOException
FastInfosetException
IOException
protected final void processAIIEncodingAlgorithm(QualifiedName name, boolean addToTable) throws FastInfosetException, IOException
FastInfosetException
IOException
protected final void processBuiltInEncodingAlgorithmAsCharacters(StringBuffer buffer) throws FastInfosetException, IOException
FastInfosetException
IOException
protected final Object processBuiltInEncodingAlgorithmAsObject() throws FastInfosetException, IOException
FastInfosetException
IOException
Copyright © 2017 Oracle Corpration. All Rights Reserved.