OctetBufferListener, javax.xml.stream.XMLStreamConstants, javax.xml.stream.XMLStreamReader, FastInfosetParser, FastInfosetStreamReaderpublic class StAXDocumentParser extends Decoder implements javax.xml.stream.XMLStreamReader, FastInfosetStreamReader, OctetBufferListener
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
InputStream.
| Modifier and Type | Class | Description |
|---|---|---|
protected class |
StAXDocumentParser.NamespaceContextImpl |
Decoder.EncodingAlgorithmInputStream| Modifier and Type | Field | Description |
|---|---|---|
protected byte[] |
_algorithmData |
|
protected int |
_algorithmDataLength |
|
protected int |
_algorithmDataOffset |
|
protected int |
_algorithmId |
|
protected java.lang.String |
_algorithmURI |
|
protected AttributesHolder |
_attributes |
List of attributes
|
protected java.lang.String |
_characterEncodingScheme |
|
protected char[] |
_characters |
Characters associated with event.
|
protected int |
_charactersOffset |
|
protected boolean |
_clearAttributes |
|
protected int |
_currentNamespaceAIIsEnd |
|
protected int |
_currentNamespaceAIIsStart |
Namespaces associated with START_ELEMENT or END_ELEMENT
|
protected int |
_eventType |
Current event
|
protected int |
_internalState |
|
protected boolean |
_isAlgorithmDataCloned |
|
protected StAXManager |
_manager |
|
protected int[] |
_namespaceAIIsEndStack |
|
protected int |
_namespaceAIIsIndex |
|
protected java.lang.String[] |
_namespaceAIIsNamespaceName |
|
protected java.lang.String[] |
_namespaceAIIsPrefix |
|
protected int[] |
_namespaceAIIsPrefixIndex |
|
protected int[] |
_namespaceAIIsStartStack |
|
protected StAXDocumentParser.NamespaceContextImpl |
_nsContext |
|
protected java.lang.String |
_piData |
|
protected java.lang.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 |
_stackCount |
|
protected static int |
INTERNAL_STATE_DOUBLE_TERMINATE_ELEMENT |
|
protected static int |
INTERNAL_STATE_END_DOCUMENT |
|
protected static int |
INTERNAL_STATE_SINGLE_TERMINATE_ELEMENT_WITH_NAMESPACES |
|
protected static int |
INTERNAL_STATE_START_DOCUMENT |
|
protected static int |
INTERNAL_STATE_START_ELEMENT_TERMINATE |
|
protected static int |
INTERNAL_STATE_VOID |
_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_PROPERTYBUFFER_SIZE_PROPERTY, EXTERNAL_VOCABULARIES_PROPERTY, FORCE_STREAM_CLOSE_PROPERTY, REGISTERED_ENCODING_ALGORITHMS_PROPERTY, STRING_INTERNING_PROPERTY| Constructor | Description |
|---|---|
StAXDocumentParser() |
|
StAXDocumentParser(java.io.InputStream s) |
|
StAXDocumentParser(java.io.InputStream s,
StAXManager manager) |
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.String |
accessLocalName() |
|
int |
accessNamespaceCount() |
|
java.lang.String |
accessNamespaceURI() |
|
java.lang.String |
accessPrefix() |
|
char[] |
accessTextCharacters() |
Returns a cloned char[] representation of the internal char[] buffer.
|
int |
accessTextLength() |
|
int |
accessTextStart() |
|
protected void |
checkTextState() |
|
void |
close() |
|
protected void |
convertBase64AlorithmDataToCharacters(java.lang.StringBuffer buffer) |
|
protected void |
convertEncodingAlgorithmDataToCharacters() |
|
int |
getAttributeCount() |
|
java.lang.String |
getAttributeLocalName(int index) |
|
javax.xml.namespace.QName |
getAttributeName(int index) |
|
java.lang.String |
getAttributeNamespace(int index) |
|
java.lang.String |
getAttributeNameString(int index) |
|
java.lang.String |
getAttributePrefix(int index) |
|
AttributesHolder |
getAttributesHolder() |
|
java.lang.String |
getAttributeType(int index) |
|
java.lang.String |
getAttributeValue(int index) |
|
java.lang.String |
getAttributeValue(java.lang.String namespaceURI,
java.lang.String localName) |
|
java.lang.String |
getCharacterEncodingScheme() |
|
java.lang.String |
getElementText() |
Reads the content of a text-only element.
|
java.lang.String |
getElementText(boolean startElementRead) |
|
java.lang.String |
getEncoding() |
|
int |
getEventType() |
|
java.lang.String |
getLocalName() |
|
javax.xml.stream.Location |
getLocation() |
|
javax.xml.namespace.QName |
getName() |
|
javax.xml.namespace.NamespaceContext |
getNamespaceContext() |
|
int |
getNamespaceCount() |
|
java.lang.String |
getNamespaceDecl(java.lang.String prefix) |
|
java.lang.String |
getNamespacePrefix(int index) |
|
java.lang.String |
getNamespaceURI() |
|
java.lang.String |
getNamespaceURI(int index) |
|
java.lang.String |
getNamespaceURI(java.lang.String prefix) |
|
java.lang.String |
getNameString() |
|
java.lang.String |
getPIData() |
|
java.lang.String |
getPITarget() |
|
java.lang.String |
getPrefix() |
|
java.util.Iterator |
getPrefixes() |
|
java.lang.Object |
getProperty(java.lang.String name) |
|
java.lang.String |
getText() |
|
byte[] |
getTextAlgorithmBytes() |
Deprecated.
was deprecated due to security reasons. Now the method return cloned byte[].
|
int |
getTextAlgorithmBytes(int sourceStart,
byte[] target,
int targetStart,
int length) |
|
byte[] |
getTextAlgorithmBytesClone() |
|
int |
getTextAlgorithmIndex() |
|
int |
getTextAlgorithmLength() |
|
int |
getTextAlgorithmStart() |
|
java.lang.String |
getTextAlgorithmURI() |
|
char[] |
getTextCharacters() |
|
int |
getTextCharacters(int sourceStart,
char[] target,
int targetStart,
int length) |
|
int |
getTextLength() |
|
int |
getTextStart() |
|
java.lang.String |
getURI(java.lang.String prefix) |
|
java.lang.String |
getVersion() |
|
boolean |
hasName() |
|
boolean |
hasNext() |
|
boolean |
hasText() |
|
boolean |
hasTextAlgorithmBytes() |
|
boolean |
isAttributeSpecified(int index) |
|
boolean |
isBase64Follows() |
|
boolean |
isCharacters() |
|
boolean |
isEndElement() |
|
boolean |
isStandalone() |
|
boolean |
isStartElement() |
|
boolean |
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.
|
int |
next() |
|
int |
nextTag() |
Skips any white space (isWhiteSpace() returns true), COMMENT,
or PROCESSING_INSTRUCTION,
until a START_ELEMENT or END_ELEMENT is reached.
|
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
|
void |
onBeforeOctetBufferOverwrite() |
Callback method that will be called before the
(@link Decoder) octet buffer content is going to be changed.
|
int |
peekNext() |
Peek at the next event.
|
protected void |
processAIIEncodingAlgorithm(QualifiedName name,
boolean addToTable) |
|
protected void |
processAIIs() |
|
protected void |
processCIIEncodingAlgorithm(boolean addToTable) |
|
protected void |
processCommentII() |
|
protected void |
processDII() |
|
protected void |
processDIIOptionalProperties(int b) |
|
protected void |
processEII(QualifiedName name,
boolean hasAttributes) |
|
protected QualifiedName |
processEIIIndexLarge(int b) |
|
protected QualifiedName |
processEIIIndexMedium(int b) |
|
protected void |
processEIIWithNamespaces(boolean hasAttributes) |
|
protected QualifiedName |
processLiteralQualifiedName(int state,
QualifiedName q) |
|
protected void |
processProcessingII() |
|
protected void |
processUnexpandedEntityReference(int b) |
|
void |
require(int type,
java.lang.String namespaceURI,
java.lang.String localName) |
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.
|
void |
reset() |
Reset the decoder for reuse decoding another XML infoset.
|
protected void |
resetOnError() |
|
protected void |
resizeNamespaceAIIs() |
|
void |
setInputStream(java.io.InputStream s) |
Set the InputStream to decode the fast infoset document.
|
void |
setManager(StAXManager manager) |
|
boolean |
standaloneSet() |
_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, setBufferSize, setExternalVocabularies, setForceStreamClose, setParseFragments, setRegisteredEncodingAlgorithms, setStringInterning, setVocabularyprotected static final int INTERNAL_STATE_START_DOCUMENT
protected static final int INTERNAL_STATE_START_ELEMENT_TERMINATE
protected static final int INTERNAL_STATE_SINGLE_TERMINATE_ELEMENT_WITH_NAMESPACES
protected static final int INTERNAL_STATE_DOUBLE_TERMINATE_ELEMENT
protected static final int INTERNAL_STATE_END_DOCUMENT
protected static final int INTERNAL_STATE_VOID
protected int _internalState
protected int _eventType
protected QualifiedName[] _qNameStack
protected int[] _namespaceAIIsStartStack
protected int[] _namespaceAIIsEndStack
protected int _stackCount
protected java.lang.String[] _namespaceAIIsPrefix
protected java.lang.String[] _namespaceAIIsNamespaceName
protected int[] _namespaceAIIsPrefixIndex
protected int _namespaceAIIsIndex
protected int _currentNamespaceAIIsStart
protected int _currentNamespaceAIIsEnd
protected QualifiedName _qualifiedName
protected AttributesHolder _attributes
protected boolean _clearAttributes
protected char[] _characters
protected int _charactersOffset
protected java.lang.String _algorithmURI
protected int _algorithmId
protected boolean _isAlgorithmDataCloned
protected byte[] _algorithmData
protected int _algorithmDataOffset
protected int _algorithmDataLength
protected java.lang.String _piTarget
protected java.lang.String _piData
protected StAXDocumentParser.NamespaceContextImpl _nsContext
protected java.lang.String _characterEncodingScheme
protected StAXManager _manager
public StAXDocumentParser()
public StAXDocumentParser(java.io.InputStream s)
public StAXDocumentParser(java.io.InputStream s,
StAXManager manager)
public void setInputStream(java.io.InputStream s)
DecodersetInputStream in class Decoders - the InputStream where the fast infoset document is decoded from.public void reset()
Decoderprotected void resetOnError()
public java.lang.Object getProperty(java.lang.String name)
throws java.lang.IllegalArgumentException
getProperty in interface javax.xml.stream.XMLStreamReaderjava.lang.IllegalArgumentExceptionpublic int next()
throws javax.xml.stream.XMLStreamException
next in interface javax.xml.stream.XMLStreamReaderjavax.xml.stream.XMLStreamExceptionpublic final void require(int type,
java.lang.String namespaceURI,
java.lang.String localName)
throws javax.xml.stream.XMLStreamException
require in interface javax.xml.stream.XMLStreamReadertype - the event typenamespaceURI - the uri of the event, may be nulllocalName - the localName of the event, may be nulljavax.xml.stream.XMLStreamException - if the required values are not matched.public final java.lang.String getElementText()
throws javax.xml.stream.XMLStreamException
getElementText in interface javax.xml.stream.XMLStreamReaderjavax.xml.stream.XMLStreamException - if the current event is not a START_ELEMENT or if
a non text element is encounteredpublic final java.lang.String getElementText(boolean startElementRead)
throws javax.xml.stream.XMLStreamException
startElementRead - flag if start element has already been readjavax.xml.stream.XMLStreamExceptionpublic final int nextTag()
throws javax.xml.stream.XMLStreamException
nextTag in interface javax.xml.stream.XMLStreamReaderjavax.xml.stream.XMLStreamException - if the current event is not white spacepublic final int nextTag(boolean currentTagRead)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic final boolean hasNext()
throws javax.xml.stream.XMLStreamException
hasNext in interface javax.xml.stream.XMLStreamReaderjavax.xml.stream.XMLStreamExceptionpublic void close()
throws javax.xml.stream.XMLStreamException
close in interface javax.xml.stream.XMLStreamReaderjavax.xml.stream.XMLStreamExceptionpublic final java.lang.String getNamespaceURI(java.lang.String prefix)
getNamespaceURI in interface javax.xml.stream.XMLStreamReaderpublic final boolean isStartElement()
isStartElement in interface javax.xml.stream.XMLStreamReaderpublic final boolean isEndElement()
isEndElement in interface javax.xml.stream.XMLStreamReaderpublic final boolean isCharacters()
isCharacters in interface javax.xml.stream.XMLStreamReaderpublic final boolean isWhiteSpace()
isWhiteSpace in interface javax.xml.stream.XMLStreamReaderpublic final java.lang.String getAttributeValue(java.lang.String namespaceURI,
java.lang.String localName)
getAttributeValue in interface javax.xml.stream.XMLStreamReaderpublic final int getAttributeCount()
getAttributeCount in interface javax.xml.stream.XMLStreamReaderpublic final javax.xml.namespace.QName getAttributeName(int index)
getAttributeName in interface javax.xml.stream.XMLStreamReaderpublic final java.lang.String getAttributeNamespace(int index)
getAttributeNamespace in interface javax.xml.stream.XMLStreamReaderpublic final java.lang.String getAttributeLocalName(int index)
getAttributeLocalName in interface javax.xml.stream.XMLStreamReaderpublic final java.lang.String getAttributePrefix(int index)
getAttributePrefix in interface javax.xml.stream.XMLStreamReaderpublic final java.lang.String getAttributeType(int index)
getAttributeType in interface javax.xml.stream.XMLStreamReaderpublic final java.lang.String getAttributeValue(int index)
getAttributeValue in interface javax.xml.stream.XMLStreamReaderpublic final boolean isAttributeSpecified(int index)
isAttributeSpecified in interface javax.xml.stream.XMLStreamReaderpublic final int getNamespaceCount()
getNamespaceCount in interface javax.xml.stream.XMLStreamReaderpublic final java.lang.String getNamespacePrefix(int index)
getNamespacePrefix in interface javax.xml.stream.XMLStreamReaderpublic final java.lang.String getNamespaceURI(int index)
getNamespaceURI in interface javax.xml.stream.XMLStreamReaderpublic final javax.xml.namespace.NamespaceContext getNamespaceContext()
getNamespaceContext in interface javax.xml.stream.XMLStreamReaderpublic final int getEventType()
getEventType in interface javax.xml.stream.XMLStreamReaderpublic final java.lang.String getText()
getText in interface javax.xml.stream.XMLStreamReaderpublic final char[] getTextCharacters()
getTextCharacters in interface javax.xml.stream.XMLStreamReaderpublic final int getTextStart()
getTextStart in interface javax.xml.stream.XMLStreamReaderpublic final int getTextLength()
getTextLength in interface javax.xml.stream.XMLStreamReaderpublic final int getTextCharacters(int sourceStart,
char[] target,
int targetStart,
int length)
throws javax.xml.stream.XMLStreamException
getTextCharacters in interface javax.xml.stream.XMLStreamReaderjavax.xml.stream.XMLStreamExceptionprotected final void checkTextState()
public final java.lang.String getEncoding()
getEncoding in interface javax.xml.stream.XMLStreamReaderpublic final boolean hasText()
hasText in interface javax.xml.stream.XMLStreamReaderpublic final javax.xml.stream.Location getLocation()
getLocation in interface javax.xml.stream.XMLStreamReaderpublic final javax.xml.namespace.QName getName()
getName in interface javax.xml.stream.XMLStreamReaderpublic final java.lang.String getLocalName()
getLocalName in interface javax.xml.stream.XMLStreamReaderpublic final boolean hasName()
hasName in interface javax.xml.stream.XMLStreamReaderpublic final java.lang.String getNamespaceURI()
getNamespaceURI in interface javax.xml.stream.XMLStreamReaderpublic final java.lang.String getPrefix()
getPrefix in interface javax.xml.stream.XMLStreamReaderpublic final java.lang.String getVersion()
getVersion in interface javax.xml.stream.XMLStreamReaderpublic final boolean isStandalone()
isStandalone in interface javax.xml.stream.XMLStreamReaderpublic final boolean standaloneSet()
standaloneSet in interface javax.xml.stream.XMLStreamReaderpublic final java.lang.String getCharacterEncodingScheme()
getCharacterEncodingScheme in interface javax.xml.stream.XMLStreamReaderpublic final java.lang.String getPITarget()
getPITarget in interface javax.xml.stream.XMLStreamReaderpublic final java.lang.String getPIData()
getPIData in interface javax.xml.stream.XMLStreamReaderpublic final java.lang.String getNameString()
public final java.lang.String getAttributeNameString(int index)
public final java.lang.String getTextAlgorithmURI()
public final int getTextAlgorithmIndex()
public final boolean hasTextAlgorithmBytes()
public final byte[] getTextAlgorithmBytes()
public final byte[] getTextAlgorithmBytesClone()
public final int getTextAlgorithmStart()
public final int getTextAlgorithmLength()
public final int getTextAlgorithmBytes(int sourceStart,
byte[] target,
int targetStart,
int length)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic final int peekNext()
throws javax.xml.stream.XMLStreamException
FastInfosetStreamReaderpeekNext in interface FastInfosetStreamReader#next.javax.xml.stream.XMLStreamExceptionpublic void onBeforeOctetBufferOverwrite()
OctetBufferListeneronBeforeOctetBufferOverwrite in interface OctetBufferListenerpublic final int accessNamespaceCount()
accessNamespaceCount in interface FastInfosetStreamReaderpublic final java.lang.String accessLocalName()
accessLocalName in interface FastInfosetStreamReaderpublic final java.lang.String accessNamespaceURI()
accessNamespaceURI in interface FastInfosetStreamReaderpublic final java.lang.String accessPrefix()
accessPrefix in interface FastInfosetStreamReaderpublic final char[] accessTextCharacters()
FastInfosetStreamReaderaccessTextCharacters in interface FastInfosetStreamReaderpublic final int accessTextStart()
accessTextStart in interface FastInfosetStreamReaderpublic final int accessTextLength()
accessTextLength in interface FastInfosetStreamReaderprotected final void processDII()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void processDIIOptionalProperties(int b)
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void resizeNamespaceAIIs()
protected final void processEIIWithNamespaces(boolean hasAttributes)
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void processEII(QualifiedName name, boolean hasAttributes) throws FastInfosetException, java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void processAIIs()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final QualifiedName processEIIIndexMedium(int b) throws FastInfosetException, java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final QualifiedName processEIIIndexLarge(int b) throws FastInfosetException, java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final QualifiedName processLiteralQualifiedName(int state, QualifiedName q) throws FastInfosetException, java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void processCommentII()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void processProcessingII()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void processUnexpandedEntityReference(int b)
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void processCIIEncodingAlgorithm(boolean addToTable)
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void processAIIEncodingAlgorithm(QualifiedName name, boolean addToTable) throws FastInfosetException, java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected final void convertEncodingAlgorithmDataToCharacters()
throws FastInfosetException,
java.io.IOException
FastInfosetExceptionjava.io.IOExceptionprotected void convertBase64AlorithmDataToCharacters(java.lang.StringBuffer buffer)
throws EncodingAlgorithmException,
java.io.IOException
EncodingAlgorithmExceptionjava.io.IOExceptionpublic boolean isBase64Follows()
throws java.io.IOException
java.io.IOExceptionpublic final java.lang.String getNamespaceDecl(java.lang.String prefix)
public final java.lang.String getURI(java.lang.String prefix)
public final java.util.Iterator getPrefixes()
public final AttributesHolder getAttributesHolder()
public final void setManager(StAXManager manager)
Copyright © 2018 Oracle Corporation. All rights reserved.