FastInfosetParserDOMDocumentParser, SAXDocumentParser, StAXDocumentParserpublic abstract class Decoder extends java.lang.Object implements FastInfosetParser
This class extends org.sax.xml.DefaultHandler so that concrete SAX implementations can be used with javax.xml.parsers.SAXParser and the parse methods that take org.sax.xml.DefaultHandler as a parameter.
Buffering of octets that are read from an InputStream is
supported in a similar manner to a BufferedInputStream.
Combining buffering with decoding enables better performance.
More than one fast infoset document may be decoded from the
InputStream.
| Modifier and Type | Class | Description |
|---|---|---|
protected class |
Decoder.EncodingAlgorithmInputStream |
| Modifier and Type | Field | Description |
|---|---|---|
protected boolean |
_addToTable |
True if an entry is required to be added to a table
|
protected QualifiedNameArray |
_attributeNameTable |
The attribute name table of the vocabulary.
|
protected StringArray |
_attributeValueTable |
The attribute value table of the vocabulary.
|
protected int |
_b |
The current octet that is being read
|
protected int |
_bufferSize |
The size of the internal buffer.
|
protected ContiguousCharArrayArray |
_characterContentChunkTable |
The character content chunk table of the vocabulary.
|
protected char[] |
_charBuffer |
The internal buffer of characters.
|
protected int |
_charBufferLength |
The length of characters in the buffer of characters.
|
protected boolean |
_doubleTerminate |
True if two information item are terminated in direct sequence.
|
protected DuplicateAttributeVerifier |
_duplicateAttributeVerifier |
Helper class that checks for duplicate attribute information items.
|
protected QualifiedNameArray |
_elementNameTable |
The element name table of the vocabulary.
|
protected int |
_identifier |
The vocabulary table index of identifying string or the identifier of
an encoding algorithm or restricted alphabet.
|
protected int |
_integer |
The vocabulary table index to an indexed non identifying string.
|
protected int |
_namespaceNameIndex |
|
protected boolean |
_needForceStreamClose |
True if needs to close underlying input stream.
|
protected java.util.List |
_notations |
The list of Notation Information Items that are part of the
Document Information Item.
|
protected byte[] |
_octetBuffer |
The internal buffer used for decoding.
|
protected int |
_octetBufferEnd |
The end of the buffer.
|
protected int |
_octetBufferLength |
The length of some octets in the buffer that are to be read.
|
protected int |
_octetBufferOffset |
The offset into the buffer to read the next byte.
|
protected int |
_octetBufferStart |
A mark into the internal buffer used for decoding encoded algorithm
or restricted alphabet data.
|
protected boolean |
_parseFragments |
True if can parse fragments.
|
protected int |
_prefixIndex |
|
protected PrefixArray |
_prefixTable |
The prefix table of the vocabulary.
|
protected java.util.Map |
_registeredEncodingAlgorithms |
The map of URIs to registered encoding algorithms.
|
protected boolean |
_terminate |
True if an information item is terminated.
|
protected java.util.List |
_unparsedEntities |
The list of Unparsed Entity Information Items that are part of the
Document Information Item.
|
protected ParserVocabulary |
_v |
The vocabulary used for decoding.
|
static java.lang.String |
BUFFER_SIZE_SYSTEM_PROPERTY |
Internal buffer size interning system property.
|
protected static int |
NISTRING_EMPTY_STRING |
|
protected static int |
NISTRING_ENCODING_ALGORITHM |
|
protected static int |
NISTRING_INDEX |
|
protected static int |
NISTRING_STRING |
|
static java.lang.String |
STRING_INTERNING_SYSTEM_PROPERTY |
String interning system property.
|
BUFFER_SIZE_PROPERTY, EXTERNAL_VOCABULARIES_PROPERTY, FORCE_STREAM_CLOSE_PROPERTY, REGISTERED_ENCODING_ALGORITHMS_PROPERTY, STRING_INTERNING_PROPERTY| Modifier | Constructor | Description |
|---|---|---|
protected |
Decoder() |
Default constructor for the Decoder.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected boolean |
_isFastInfosetDocument() |
|
protected void |
closeIfRequired() |
|
protected java.lang.String |
createQualifiedNameString(char[] first,
java.lang.String second) |
|
protected java.lang.String |
createQualifiedNameString(java.lang.String second) |
|
protected void |
decodeAdditionalData() |
|
protected void |
decodeAlphabetOctetsAsCharBuffer(char[] restrictedAlphabet) |
|
protected java.lang.String |
decodeCharacterEncodingScheme() |
|
protected void |
decodeDII() |
|
protected QualifiedName |
decodeEIIIndexLarge() |
|
protected QualifiedName |
decodeEIIIndexMedium() |
|
protected void |
decodeFourBitAlphabetOctetsAsCharBuffer(char[] restrictedAlphabet) |
|
protected void |
decodeHeader() |
|
protected java.lang.String |
decodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceName(boolean prefixPresent) |
|
protected java.lang.String |
decodeIdentifyingNonEmptyStringIndexOnFirstBitAsPrefix(boolean namespaceNamePresent) |
|
protected java.lang.String |
decodeIdentifyingNonEmptyStringOnFirstBit(StringArray table) |
|
protected java.lang.String |
decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(boolean prefixPresent) |
|
protected java.lang.String |
decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(boolean namespaceNamePresent) |
|
protected void |
decodeInitialVocabulary() |
|
protected int |
decodeIntegerIndexOnSecondBit() |
|
protected QualifiedName |
decodeLiteralQualifiedName(int state,
QualifiedName q) |
|
protected void |
decodeNonEmptyOctetStringLengthOnSecondBit() |
|
protected void |
decodeNonEmptyOctetStringOnSecondBitAsUtf8CharArray() |
|
protected java.lang.String |
decodeNonEmptyOctetStringOnSecondBitAsUtf8String() |
|
protected int |
decodeNonIdentifyingStringOnFirstBit() |
|
protected void |
decodeNotations() |
|
protected void |
decodeOctetsOnFifthBitOfNonIdentifyingStringOnFirstBit(int b) |
|
protected void |
decodeOctetsOnSeventhBitOfNonIdentifyingStringOnThirdBit(int b) |
|
protected java.lang.String |
decodeRAOctetsAsString(char[] restrictedAlphabet) |
|
protected void |
decodeRestrictedAlphabetAsCharBuffer() |
|
protected java.lang.String |
decodeRestrictedAlphabetAsString() |
|
protected void |
decodeUnparsedEntities() |
|
protected void |
decodeUtf16StringAsCharBuffer() |
|
protected java.lang.String |
decodeUtf16StringAsString() |
|
protected void |
decodeUtf8NCNameIntoCharBuffer() |
|
protected void |
decodeUtf8StringAsCharBuffer() |
|
protected void |
decodeUtf8StringAsCharBuffer(char[] ch,
int offset) |
|
protected java.lang.String |
decodeUtf8StringAsString() |
|
protected void |
decodeUtf8StringIntoCharBuffer() |
|
protected void |
decodeUtf8StringIntoCharBuffer(char[] ch,
int offset) |
|
protected java.lang.String |
decodeVersion() |
|
int |
getBufferSize() |
Get the buffer size.
|
java.util.Map |
getExternalVocabularies() |
Get the map of referenced external vocabularies.
|
boolean |
getForceStreamClose() |
Return the force stream close property.
|
boolean |
getParseFragments() |
Return the parse fragments property.
|
java.util.Map |
getRegisteredEncodingAlgorithms() |
Gets the set of registered encoding algorithms.
|
boolean |
getStringInterning() |
Return the string interning property.
|
static boolean |
isFastInfosetDocument(java.io.InputStream s) |
|
protected int |
peek() |
|
protected int |
peek(OctetBufferListener octetBufferListener) |
|
protected int |
peek2(OctetBufferListener octetBufferListener) |
|
protected int |
read() |
|
void |
reset() |
Reset the decoder for reuse decoding another XML infoset.
|
void |
setBufferSize(int bufferSize) |
Set the buffer size.
|
void |
setExternalVocabularies(java.util.Map referencedVocabualries) |
Set the map of referenced external vocabularies.
|
void |
setForceStreamClose(boolean needForceStreamClose) |
Set the force stream close property.
|
void |
setInputStream(java.io.InputStream s) |
Set the InputStream to decode the fast infoset document.
|
void |
setParseFragments(boolean parseFragments) |
Set the parse fragments property.
|
void |
setRegisteredEncodingAlgorithms(java.util.Map algorithms) |
Sets the set of registered encoding algorithms.
|
void |
setStringInterning(boolean stringInterning) |
Set the string interning property.
|
void |
setVocabulary(ParserVocabulary v) |
Set the ParserVocabulary to be used for decoding.
|
public static final java.lang.String STRING_INTERNING_SYSTEM_PROPERTY
public static final java.lang.String BUFFER_SIZE_SYSTEM_PROPERTY
protected boolean _parseFragments
protected boolean _needForceStreamClose
protected java.util.List _notations
protected java.util.List _unparsedEntities
protected java.util.Map _registeredEncodingAlgorithms
protected ParserVocabulary _v
protected PrefixArray _prefixTable
protected QualifiedNameArray _elementNameTable
protected QualifiedNameArray _attributeNameTable
protected ContiguousCharArrayArray _characterContentChunkTable
protected StringArray _attributeValueTable
protected int _b
protected boolean _terminate
protected boolean _doubleTerminate
protected boolean _addToTable
protected int _integer
protected int _identifier
protected int _bufferSize
protected byte[] _octetBuffer
protected int _octetBufferStart
protected int _octetBufferOffset
protected int _octetBufferEnd
protected int _octetBufferLength
protected char[] _charBuffer
protected int _charBufferLength
protected DuplicateAttributeVerifier _duplicateAttributeVerifier
protected static final int NISTRING_STRING
protected static final int NISTRING_INDEX
protected static final int NISTRING_ENCODING_ALGORITHM
protected static final int NISTRING_EMPTY_STRING
protected int _prefixIndex
protected int _namespaceNameIndex
public void setStringInterning(boolean stringInterning)
If the string interning property is set to true then
String objects instantiated for [namespace name], [prefix]
and [local name] infoset properties will be interned using the method
String.intern().
setStringInterning in interface FastInfosetParserstringInterning - The string interning property.public boolean getStringInterning()
getStringInterning in interface FastInfosetParserpublic void setBufferSize(int bufferSize)
The size of the buffer for parsing is set using this method. Requests for sizes smaller then the current size will be ignored. Otherwise the buffer will be resized when the next parse is performed.
setBufferSize in interface FastInfosetParserbufferSize - The requested buffer size.public int getBufferSize()
getBufferSize in interface FastInfosetParserpublic void setRegisteredEncodingAlgorithms(java.util.Map algorithms)
setRegisteredEncodingAlgorithms in interface FastInfosetParseralgorithms - The set of registered algorithms.public java.util.Map getRegisteredEncodingAlgorithms()
getRegisteredEncodingAlgorithms in interface FastInfosetParserpublic void setExternalVocabularies(java.util.Map referencedVocabualries)
The map (but not the keys and values) be cloned.
setExternalVocabularies in interface FastInfosetParserreferencedVocabualries - the map of URI to vocabulary.public java.util.Map getExternalVocabularies()
getExternalVocabularies in interface FastInfosetParserpublic void setParseFragments(boolean parseFragments)
If the parse fragments property is set to true then fragments of an XML infoset may be parsed.
setParseFragments in interface FastInfosetParserparseFragments - The parse fragments property.public boolean getParseFragments()
getParseFragments in interface FastInfosetParserpublic void setForceStreamClose(boolean needForceStreamClose)
If the force stream property is set to true then Parser's underlying InputStream will be closed.
setForceStreamClose in interface FastInfosetParserneedForceStreamClose - The force stream close property.public boolean getForceStreamClose()
getForceStreamClose in interface FastInfosetParserpublic void reset()
public void setVocabulary(ParserVocabulary v)
v - the vocabulary to be used for decoding.public void setInputStream(java.io.InputStream s)
s - the InputStream where the fast infoset document is decoded from.protected final void decodeDII()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void decodeAdditionalData()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void decodeInitialVocabulary()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void decodeNotations()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void decodeUnparsedEntities()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final java.lang.String decodeCharacterEncodingScheme()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final java.lang.String decodeVersion()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final QualifiedName decodeEIIIndexMedium() throws FastInfosetException, java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final QualifiedName decodeEIIIndexLarge() throws FastInfosetException, java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final QualifiedName decodeLiteralQualifiedName(int state, QualifiedName q) throws FastInfosetException, java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final int decodeNonIdentifyingStringOnFirstBit()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void decodeOctetsOnFifthBitOfNonIdentifyingStringOnFirstBit(int b)
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void decodeOctetsOnSeventhBitOfNonIdentifyingStringOnThirdBit(int b)
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final java.lang.String decodeIdentifyingNonEmptyStringOnFirstBit(StringArray table) throws FastInfosetException, java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final java.lang.String decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(boolean namespaceNamePresent)
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final java.lang.String decodeIdentifyingNonEmptyStringIndexOnFirstBitAsPrefix(boolean namespaceNamePresent)
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final java.lang.String decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(boolean prefixPresent)
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final java.lang.String decodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceName(boolean prefixPresent)
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final java.lang.String decodeNonEmptyOctetStringOnSecondBitAsUtf8String()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void decodeNonEmptyOctetStringOnSecondBitAsUtf8CharArray()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void decodeNonEmptyOctetStringLengthOnSecondBit()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final int decodeIntegerIndexOnSecondBit()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void decodeHeader()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void decodeRestrictedAlphabetAsCharBuffer()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final java.lang.String decodeRestrictedAlphabetAsString()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final java.lang.String decodeRAOctetsAsString(char[] restrictedAlphabet)
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void decodeFourBitAlphabetOctetsAsCharBuffer(char[] restrictedAlphabet)
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void decodeAlphabetOctetsAsCharBuffer(char[] restrictedAlphabet)
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void decodeUtf8StringAsCharBuffer()
throws java.io.IOException
java.io.IOExceptionprotected final void decodeUtf8StringAsCharBuffer(char[] ch,
int offset)
throws java.io.IOException
java.io.IOExceptionprotected final java.lang.String decodeUtf8StringAsString()
throws java.io.IOException
java.io.IOExceptionprotected final void decodeUtf16StringAsCharBuffer()
throws java.io.IOException
java.io.IOExceptionprotected final java.lang.String decodeUtf16StringAsString()
throws java.io.IOException
java.io.IOExceptionprotected final void decodeUtf8StringIntoCharBuffer()
throws java.io.IOException
java.io.IOExceptionprotected final void decodeUtf8StringIntoCharBuffer(char[] ch,
int offset)
throws java.io.IOException
java.io.IOExceptionprotected final void decodeUtf8NCNameIntoCharBuffer()
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String createQualifiedNameString(java.lang.String second)
protected java.lang.String createQualifiedNameString(char[] first,
java.lang.String second)
protected final int read()
throws java.io.IOException
java.io.IOExceptionprotected final void closeIfRequired()
throws java.io.IOException
java.io.IOExceptionprotected final int peek()
throws java.io.IOException
java.io.IOExceptionprotected final int peek(OctetBufferListener octetBufferListener) throws java.io.IOException
java.io.IOExceptionprotected final int peek2(OctetBufferListener octetBufferListener) throws java.io.IOException
java.io.IOExceptionprotected final boolean _isFastInfosetDocument()
throws java.io.IOException
java.io.IOExceptionpublic static boolean isFastInfosetDocument(java.io.InputStream s)
throws java.io.IOException
java.io.IOExceptionCopyright © 2018 Oracle Corporation. All rights reserved.