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

public Class StAXDocumentParser

extends Decoder
implements XMLStreamReader, FastInfosetStreamReader, OctetBufferListener
Class Inheritance
All Implemented Interfaces
com.sun.xml.fastinfoset.OctetBufferListener, org.jvnet.fastinfoset.stax.FastInfosetStreamReader, javax.xml.stream.XMLStreamReader, javax.xml.stream.XMLStreamConstants
Imports
com.sun.xml.fastinfoset.Decoder, .DecoderStateTables, .EncodingConstants, .OctetBufferListener, .QualifiedName, .CommonResourceBundle, com.sun.xml.fastinfoset.algorithm.BuiltInEncodingAlgorithmFactory, com.sun.xml.fastinfoset.sax.AttributesHolder, com.sun.xml.fastinfoset.util.CharArray, .CharArrayString, .DuplicateAttributeVerifier, java.io.IOException, .InputStream, java.util.Iterator, .NoSuchElementException, javax.xml.namespace.NamespaceContext, .QName, javax.xml.stream.Location, .XMLStreamException, .XMLStreamReader, org.jvnet.fastinfoset.EncodingAlgorithm, .EncodingAlgorithmException, .EncodingAlgorithmIndexes, .FastInfosetException, com.sun.xml.fastinfoset.org.apache.xerces.util.XMLChar, java.util.logging.Level, .Logger, org.jvnet.fastinfoset.stax.FastInfosetStreamReader

The Fast Infoset StAX parser.

Instantiate this parser to parse a fast infoset document in accordance with the StAX API.

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 byte[]
protected int
protected int
protected int
protected String
protected AttributesHolder
_attributes

List of attributes

protected String
protected char[]
_characters

Characters associated with event.

protected int
protected boolean
protected int
protected int
_currentNamespaceAIIsStart

Namespaces associated with START_ELEMENT or END_ELEMENT

protected int
_eventType

Current event

protected int
protected boolean
protected StAXManager
protected int[]
protected int
protected String[]
protected String[]
protected int[]
protected int[]
protected StAXDocumentParser.NamespaceContextImpl
protected String
protected String
_piTarget

State for processing instruction

protected QualifiedName[]
_qNameStack

Stack of qualified names and namespaces

protected QualifiedName
_qualifiedName

Qualified name associated with START_ELEMENT or END_ELEMENT.

protected int
private byte[]
private int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
private static final Logger
Inherited from 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_vBUFFER_SIZE_SYSTEM_PROPERTYNISTRING_EMPTY_STRINGNISTRING_ENCODING_ALGORITHMNISTRING_INDEXNISTRING_STRINGSTRING_INTERNING_SYSTEM_PROPERTY

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
public final String
public final int
public final String
public final String
public final char[]
accessTextCharacters()

Implements org.jvnet.fastinfoset.stax.FastInfosetStreamReader.accessTextCharacters.

Returns a cloned char[] representation of the internal char[] buffer.

public final int
public final int
private void
base64DecodeWithCloning(StringBuilder dstBuffer, byte[] data, int offset, int length)

private void
base64DecodeWithoutCloning(StringBuilder dstBuffer, byte[] data, int offset, int length)

protected final void
public void
close()

Implements javax.xml.stream.XMLStreamReader.close.

Frees any resources associated with this Reader.

protected void
protected void
protected final void
public final int
getAttributeCount()

Implements javax.xml.stream.XMLStreamReader.getAttributeCount.

Returns the count of attributes on this START_ELEMENT, this method is only valid on a START_ELEMENT or ATTRIBUTE.

public final String
getAttributeLocalName(int index)

Implements javax.xml.stream.XMLStreamReader.getAttributeLocalName.

Returns the localName of the attribute at the provided index

public final QName
getAttributeName(int index)

Implements javax.xml.stream.XMLStreamReader.getAttributeName.

Returns the qname of the attribute at the provided index

public final String
getAttributeNamespace(int index)

Implements javax.xml.stream.XMLStreamReader.getAttributeNamespace.

Returns the namespace of the attribute at the provided index

public final String
public final String
getAttributePrefix(int index)

Implements javax.xml.stream.XMLStreamReader.getAttributePrefix.

Returns the prefix of this attribute at the provided index

public final AttributesHolder
public final String
getAttributeType(int index)

Implements javax.xml.stream.XMLStreamReader.getAttributeType.

Returns the XML type of the attribute at the provided index

public final String
getAttributeValue(String namespaceURI, String localName)

Implements javax.xml.stream.XMLStreamReader.getAttributeValue.

Returns the normalized attribute value of the attribute with the namespace and localName If the namespaceURI is null the namespace is not checked for equality

public final String
getAttributeValue(int index)

Implements javax.xml.stream.XMLStreamReader.getAttributeValue.

Returns the value of the attribute at the index

public final String
getCharacterEncodingScheme()

Implements javax.xml.stream.XMLStreamReader.getCharacterEncodingScheme.

Returns the character encoding declared on the xml declaration Returns null if none was declared

public final String
getElementText()

Implements javax.xml.stream.XMLStreamReader.getElementText.

Reads the content of a text-only element.

public final String
getElementText(boolean
flag if start element has already been read
startElementRead
)

public final String
getEncoding()

Implements javax.xml.stream.XMLStreamReader.getEncoding.

Return input encoding if known or null if unknown.

public final int
getEventType()

Implements javax.xml.stream.XMLStreamReader.getEventType.

Returns an integer code that indicates the type of the event the cursor is pointing to.

pack-priv static final String
getEventTypeString(int eventType)

public final String
getLocalName()

Implements javax.xml.stream.XMLStreamReader.getLocalName.

Returns the (local) name of the current event.

public final Location
getLocation()

Implements javax.xml.stream.XMLStreamReader.getLocation.

Return the current location of the processor.

public final QName
getName()

Implements javax.xml.stream.XMLStreamReader.getName.

Returns a QName for the current START_ELEMENT or END_ELEMENT event

public final NamespaceContext
getNamespaceContext()

Implements javax.xml.stream.XMLStreamReader.getNamespaceContext.

Returns a read only namespace context for the current position.

public final int
getNamespaceCount()

Implements javax.xml.stream.XMLStreamReader.getNamespaceCount.

Returns the count of namespaces declared on this START_ELEMENT or END_ELEMENT, this method is only valid on a START_ELEMENT, END_ELEMENT or NAMESPACE.

public final String
public final String
getNamespacePrefix(int index)

Implements javax.xml.stream.XMLStreamReader.getNamespacePrefix.

Returns the prefix for the namespace declared at the index.

public final String
getNamespaceURI(String prefix)

Implements javax.xml.stream.XMLStreamReader.getNamespaceURI.

Return the uri for the given prefix.

public final String
getNamespaceURI(int index)

Implements javax.xml.stream.XMLStreamReader.getNamespaceURI.

Returns the uri for the namespace declared at the index.

public final String
getNamespaceURI()

Implements javax.xml.stream.XMLStreamReader.getNamespaceURI.

If the current event is a START_ELEMENT or END_ELEMENT this method returns the URI of the prefix or the default namespace.

public final String
public final String
getPIData()

Implements javax.xml.stream.XMLStreamReader.getPIData.

Get the data section of a processing instruction

public final String
getPITarget()

Implements javax.xml.stream.XMLStreamReader.getPITarget.

Get the target of a processing instruction

public final String
getPrefix()

Implements javax.xml.stream.XMLStreamReader.getPrefix.

Returns the prefix of the current event or null if the event does not have a prefix

public final Iterator<String>
public Object
getProperty(String name)

Implements javax.xml.stream.XMLStreamReader.getProperty.

Get the value of a feature/property from the underlying implementation

public final String
getText()

Implements javax.xml.stream.XMLStreamReader.getText.

Returns the current value of the parse event as a string, this returns the string value of a CHARACTERS event, returns the value of a COMMENT, the replacement value for an ENTITY_REFERENCE, the string value of a CDATA section, the string value for a SPACE event, or the String value of the internal subset of the DTD.

public final byte[]
getTextAlgorithmBytes()

Returns the byte[], which represents text algorithms.

public final int
getTextAlgorithmBytes(int sourceStart, byte[] target, int targetStart, int length)

public final byte[]
public final int
public final int
public final int
public final String
public final char[]
getTextCharacters()

Implements javax.xml.stream.XMLStreamReader.getTextCharacters.

Returns an array which contains the characters from this event.

public final int
getTextCharacters(int sourceStart, char[] target, int targetStart, int length)

Implements javax.xml.stream.XMLStreamReader.getTextCharacters.

Gets the text associated with a CHARACTERS, SPACE or CDATA event.

public final int
getTextLength()

Implements javax.xml.stream.XMLStreamReader.getTextLength.

Returns the length of the sequence of characters for this Text event within the text character array.

public final int
getTextStart()

Implements javax.xml.stream.XMLStreamReader.getTextStart.

Returns the offset into the text character array where the first character (of this text event) is stored.

public final String
getURI(String prefix)

public final String
getVersion()

Implements javax.xml.stream.XMLStreamReader.getVersion.

Get the xml version declared on the xml declaration Returns null if none was declared

public final boolean
hasName()

Implements javax.xml.stream.XMLStreamReader.hasName.

returns a boolean indicating whether the current event has a name (is a START_ELEMENT or END_ELEMENT).

public final boolean
hasNext()

Implements javax.xml.stream.XMLStreamReader.hasNext.

Returns true if there are more parsing events and false if there are no more events.

public final boolean
hasText()

Implements javax.xml.stream.XMLStreamReader.hasText.

Return a boolean indicating whether the current event has text.

public final boolean
public final boolean
isAttributeSpecified(int index)

Implements javax.xml.stream.XMLStreamReader.isAttributeSpecified.

Returns a boolean which indicates if this attribute was created by default

public boolean
public final boolean
isCharacters()

Implements javax.xml.stream.XMLStreamReader.isCharacters.

Returns true if the cursor points to a character data event

public final boolean
isEndElement()

Implements javax.xml.stream.XMLStreamReader.isEndElement.

Returns true if the cursor points to an end tag (otherwise false)

public final boolean
isStandalone()

Implements javax.xml.stream.XMLStreamReader.isStandalone.

Get the standalone declaration from the xml declaration

public final boolean
isStartElement()

Implements javax.xml.stream.XMLStreamReader.isStartElement.

Returns true if the cursor points to a start tag (otherwise false)

public final boolean

Returns:

true if the cursor points to all whitespace, false otherwise
isWhiteSpace
()

Implements javax.xml.stream.XMLStreamReader.isWhiteSpace.

Returns true if the cursor points to a character data event that consists of all whitespace Application calling this method needs to cache the value and avoid calling this method again for the same event.

public int
next()

Implements javax.xml.stream.XMLStreamReader.next.

Get next parsing event - a processor may return all contiguous character data in a single chunk, or it may split it into several chunks.

public final int

Returns:

the event type of the element read
nextTag
()

Implements javax.xml.stream.XMLStreamReader.nextTag.

Skips any white space (isWhiteSpace() returns true), COMMENT, or PROCESSING_INSTRUCTION, until a START_ELEMENT or END_ELEMENT is reached.

public final int
nextTag(boolean currentTagRead)

if the current tag has already read, such as in the case EventReader's peek() has been called, the current cursor should not move before the loop

public void
onBeforeOctetBufferOverwrite()

Implements com.sun.xml.fastinfoset.OctetBufferListener.onBeforeOctetBufferOverwrite.

Callback method that will be called before the (@link Decoder) octet buffer content is going to be changed.

public final int
private void
protected final void
processAIIEncodingAlgorithm(QualifiedName name, boolean addToTable)

protected final void
protected final void
processCIIEncodingAlgorithm(boolean addToTable)

protected final void
protected final void
protected final void
protected final void
processEII(QualifiedName name, boolean hasAttributes)

protected final QualifiedName
protected final QualifiedName
protected final void
processEIIWithNamespaces(boolean hasAttributes)

protected final QualifiedName
protected final void
protected final void
private void
private void
public final void
require(int
the event type
type
,
String
the uri of the event, may be null
namespaceURI
,
String
the localName of the event, may be null
localName
)

Implements javax.xml.stream.XMLStreamReader.require.

Test if the current event is of the given type and if the namespace and name match the current namespace and name of the current event.

public void
reset()

Overrides com.sun.xml.fastinfoset.Decoder.reset.

Reset the decoder for reuse decoding another XML infoset.

protected void
protected final void
public void
setInputStream(InputStream s)

Overrides com.sun.xml.fastinfoset.Decoder.setInputStream.

Set the InputStream to decode the fast infoset document.

public final void
public final boolean
standaloneSet()

Implements javax.xml.stream.XMLStreamReader.standaloneSet.

Checks if standalone was set in the document

Inherited from com.sun.xml.fastinfoset.Decoder:
_isFastInfosetDocumentcloseIfRequiredcreateQualifiedNameStringcreateQualifiedNameStringdecodeAdditionalDatadecodeAlphabetOctetsAsCharBufferdecodeCharacterEncodingSchemedecodeDIIdecodeEIIIndexLargedecodeEIIIndexMediumdecodeFourBitAlphabetOctetsAsCharBufferdecodeHeaderdecodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceNamedecodeIdentifyingNonEmptyStringIndexOnFirstBitAsPrefixdecodeIdentifyingNonEmptyStringOnFirstBitdecodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceNamedecodeIdentifyingNonEmptyStringOnFirstBitAsPrefixdecodeInitialVocabularydecodeIntegerIndexOnSecondBitdecodeLiteralQualifiedNamedecodeNonEmptyOctetStringLengthOnSecondBitdecodeNonEmptyOctetStringOnSecondBitAsUtf8CharArraydecodeNonEmptyOctetStringOnSecondBitAsUtf8StringdecodeNonIdentifyingStringOnFirstBitdecodeNotationsdecodeOctetsOnFifthBitOfNonIdentifyingStringOnFirstBitdecodeOctetsOnSeventhBitOfNonIdentifyingStringOnThirdBitdecodeRAOctetsAsStringdecodeRestrictedAlphabetAsCharBufferdecodeRestrictedAlphabetAsStringdecodeUnparsedEntitiesdecodeUtf16StringAsCharBufferdecodeUtf16StringAsStringdecodeUtf8NCNameIntoCharBufferdecodeUtf8StringAsCharBufferdecodeUtf8StringAsCharBufferdecodeUtf8StringAsStringdecodeUtf8StringIntoCharBufferdecodeUtf8StringIntoCharBufferdecodeVersiongetBufferSizegetExternalVocabulariesgetForceStreamClosegetParseFragmentsgetRegisteredEncodingAlgorithmsgetStringInterningisFastInfosetDocumentpeekpeekpeek2readsetBufferSizesetExternalVocabulariessetForceStreamClosesetParseFragmentssetRegisteredEncodingAlgorithmssetStringInterningsetVocabulary