Top Description Inners Fields Constructors Methods
com.sun.xml.fastinfoset

public abstract Class Decoder

extends Object
implements FastInfosetParser
Class Inheritance
All Implemented Interfaces
org.jvnet.fastinfoset.FastInfosetParser
Known Direct Subclasses
com.sun.xml.fastinfoset.dom.DOMDocumentParser, com.sun.xml.fastinfoset.sax.SAXDocumentParser, com.sun.xml.fastinfoset.stax.StAXDocumentParser
Imports
com.sun.xml.fastinfoset.alphabet.BuiltInRestrictedAlphabets, com.sun.xml.fastinfoset.org.apache.xerces.util.XMLChar, com.sun.xml.fastinfoset.util.CharArray, .CharArrayArray, .CharArrayString, .ContiguousCharArrayArray, .DuplicateAttributeVerifier, .PrefixArray, .QualifiedNameArray, .StringArray, com.sun.xml.fastinfoset.vocab.ParserVocabulary, java.io.EOFException, .IOException, .InputStream, java.util.ArrayList, .HashMap, .List, .Map, org.jvnet.fastinfoset.EncodingAlgorithm, .ExternalVocabulary, .FastInfosetException, .FastInfosetParser

Abstract decoder for developing concrete encoders.

Concrete implementations extending Decoder will utilize methods on Decoder to decode XML infoset according to the Fast Infoset standard. It is the responsibility of the concrete implementation to ensure that methods are invoked in the correct order to correctly decode a valid fast infoset document.

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 java.io.InputStream is supported in a similar manner to a java.io.BufferedInputStream. Combining buffering with decoding enables better performance.

More than one fast infoset document may be decoded from the java.io.InputStream.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class

Field Summary

Modifier and TypeField and 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

private int
protected int
_bufferSize

The size of the internal buffer.

private static int
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.

private Map<String, ParserVocabulary>
_externalVocabularies

The map of URIs to referenced vocabularies.

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
protected boolean
_needForceStreamClose

True if needs to close underlying input stream.

protected List<Notation>
_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
protected PrefixArray
_prefixTable

The prefix table of the vocabulary.

protected Map<String, EncodingAlgorithm>
_registeredEncodingAlgorithms

The map of URIs to registered encoding algorithms.

private InputStream
_s

The input stream from which the fast infoset document is being read.

private boolean
_stringInterning

True if string interning is performed by the decoder.

private static boolean
protected boolean
_terminate

True if an information item is terminated.

protected List<UnparsedEntity>
_unparsedEntities

The list of Unparsed Entity Information Items that are part of the Document Information Item.

private char
private char
protected ParserVocabulary
_v

The vocabulary used for decoding.

private boolean
_vIsInternal

True if the vocabulary is internally created by decoder.

public static final String
BUFFER_SIZE_SYSTEM_PROPERTY

Internal buffer size interning system property.

protected static final int
protected static final int
protected static final int
protected static final int
public static final String
STRING_INTERNING_SYSTEM_PROPERTY

String interning system property.

private static final char[]
private static final char[]
private static final char[]

Constructor Summary

AccessConstructor and Description
protected
Decoder()

Default constructor for the Decoder.

Method Summary

Modifier and TypeMethod and Description
protected final boolean
private boolean
arrayEquals(byte[] b1, int offset, byte[] b2, int length)

protected final void
private boolean
protected String
protected String
createQualifiedNameString(char[] first, String second)

protected final void
protected final void
decodeAlphabetOctetsAsCharBuffer(char[] restrictedAlphabet)

protected final String
protected final void
protected final QualifiedName
protected final QualifiedName
private void
protected final void
decodeFourBitAlphabetOctetsAsCharBuffer(char[] restrictedAlphabet)

protected final void
protected final String
protected final String
protected final String
protected final String
protected final String
protected final void
protected final int
protected final QualifiedName
protected final void
protected final void
protected final String
protected final int
protected final void
private int
protected final void
protected final void
protected final String
decodeRAOctetsAsString(char[] restrictedAlphabet)

protected final void
protected final String
private void
private void
private void
private void
private void
decodeTableItems(QualifiedNameArray array, boolean isAttribute)

private void
private void
decodeTwoToFourByteUtf8Character(char[] ch, int b1, int end)

protected final void
protected final void
protected final String
private void
private int
decodeUtf8FourByteChar(int end, int b1)

private void
protected final void
private void
private void
protected final void
protected final void
decodeUtf8StringAsCharBuffer(char[] ch, int offset)

protected final String
private void
protected final void
protected final void
decodeUtf8StringIntoCharBuffer(char[] ch, int offset)

private void
private char
decodeUtf8ThreeByteChar(int end, int b1)

protected final String
private void
public int
public Map<String, ParserVocabulary>
getExternalVocabularies()

Implements org.jvnet.fastinfoset.FastInfosetParser.getExternalVocabularies.

Get the map of referenced external vocabularies.

public boolean
getForceStreamClose()

Implements org.jvnet.fastinfoset.FastInfosetParser.getForceStreamClose.

Return the force stream close property.

public boolean
getParseFragments()

Implements org.jvnet.fastinfoset.FastInfosetParser.getParseFragments.

Return the parse fragments property.

public Map<String, EncodingAlgorithm>
public boolean
getStringInterning()

Implements org.jvnet.fastinfoset.FastInfosetParser.getStringInterning.

Return the string interning property.

public static boolean
protected final int
peek()

protected final int
peek(OctetBufferListener octetBufferListener)

protected final int
peek2(OctetBufferListener octetBufferListener)

protected final int
read()

private int
readBits(int bits)

private void
public void
reset()

Reset the decoder for reuse decoding another XML infoset.

private void
public void
setBufferSize(int bufferSize)

Implements org.jvnet.fastinfoset.FastInfosetParser.setBufferSize.

Set the buffer size.

public void
setExternalVocabularies(Map<String, ParserVocabulary> referencedVocabualries)

Implements org.jvnet.fastinfoset.FastInfosetParser.setExternalVocabularies.

Set the map of referenced external vocabularies.

public void
setForceStreamClose(boolean needForceStreamClose)

Implements org.jvnet.fastinfoset.FastInfosetParser.setForceStreamClose.

Set the force stream close property.

public void
setInputStream(InputStream
the InputStream where the fast infoset document is decoded from.
s
)

Set the InputStream to decode the fast infoset document.

public void
setParseFragments(boolean parseFragments)

Implements org.jvnet.fastinfoset.FastInfosetParser.setParseFragments.

Set the parse fragments property.

public void
public void
setStringInterning(boolean stringInterning)

Implements org.jvnet.fastinfoset.FastInfosetParser.setStringInterning.

Set the string interning property.

public void
setVocabulary(ParserVocabulary
the vocabulary to be used for decoding.
v
)

Set the ParserVocabulary to be used for decoding.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait