public 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 and Description |
|---|---|
protected class |
StAXDocumentParser.NamespaceContextImpl |
Decoder.EncodingAlgorithmInputStream| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
_algorithmData |
protected int |
_algorithmDataLength |
protected int |
_algorithmDataOffset |
protected int |
_algorithmId |
protected String |
_algorithmURI |
protected AttributesHolder |
_attributes
List of attributes
|
protected 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 String[] |
_namespaceAIIsNamespaceName |
protected String[] |
_namespaceAIIsPrefix |
protected int[] |
_namespaceAIIsPrefixIndex |
protected int[] |
_namespaceAIIsStartStack |
protected StAXDocumentParser.NamespaceContextImpl |
_nsContext |
protected String |
_piData |
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 |
_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_PROPERTYATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENTBUFFER_SIZE_PROPERTY, EXTERNAL_VOCABULARIES_PROPERTY, FORCE_STREAM_CLOSE_PROPERTY, REGISTERED_ENCODING_ALGORITHMS_PROPERTY, STRING_INTERNING_PROPERTY| Constructor and Description |
|---|
StAXDocumentParser() |
StAXDocumentParser(InputStream s) |
StAXDocumentParser(InputStream s,
StAXManager manager) |
| Modifier and Type | Method and Description |
|---|---|
String |
accessLocalName() |
int |
accessNamespaceCount() |
String |
accessNamespaceURI() |
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(StringBuffer buffer) |
protected void |
convertEncodingAlgorithmDataToCharacters() |
int |
getAttributeCount() |
String |
getAttributeLocalName(int index) |
QName |
getAttributeName(int index) |
String |
getAttributeNamespace(int index) |
String |
getAttributeNameString(int index) |
String |
getAttributePrefix(int index) |
AttributesHolder |
getAttributesHolder() |
String |
getAttributeType(int index) |
String |
getAttributeValue(int index) |
String |
getAttributeValue(String namespaceURI,
String localName) |
String |
getCharacterEncodingScheme() |
String |
getElementText()
Reads the content of a text-only element.
|
String |
getElementText(boolean startElementRead) |
String |
getEncoding() |
int |
getEventType() |
String |
getLocalName() |
javax.xml.stream.Location |
getLocation() |
QName |
getName() |
NamespaceContext |
getNamespaceContext() |
int |
getNamespaceCount() |
String |
getNamespaceDecl(String prefix) |
String |
getNamespacePrefix(int index) |
String |
getNamespaceURI() |
String |
getNamespaceURI(int index) |
String |
getNamespaceURI(String prefix) |
String |
getNameString() |
String |
getPIData() |
String |
getPITarget() |
String |
getPrefix() |
Iterator |
getPrefixes() |
Object |
getProperty(String name) |
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() |
String |
getTextAlgorithmURI() |
char[] |
getTextCharacters() |
int |
getTextCharacters(int sourceStart,
char[] target,
int targetStart,
int length) |
int |
getTextLength() |
int |
getTextStart() |
String |
getURI(String prefix) |
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,
String namespaceURI,
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(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 String[] _namespaceAIIsPrefix
protected 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 String _algorithmURI
protected int _algorithmId
protected boolean _isAlgorithmDataCloned
protected byte[] _algorithmData
protected int _algorithmDataOffset
protected int _algorithmDataLength
protected String _piTarget
protected String _piData
protected StAXDocumentParser.NamespaceContextImpl _nsContext
protected String _characterEncodingScheme
protected StAXManager _manager
public StAXDocumentParser()
public StAXDocumentParser(InputStream s)
public StAXDocumentParser(InputStream s, StAXManager manager)
public void setInputStream(InputStream s)
DecodersetInputStream in class Decoders - the InputStream where the fast infoset document is decoded from.public void reset()
Decoderprotected void resetOnError()
public Object getProperty(String name) throws IllegalArgumentException
getProperty in interface javax.xml.stream.XMLStreamReaderIllegalArgumentExceptionpublic int next()
throws javax.xml.stream.XMLStreamException
next in interface javax.xml.stream.XMLStreamReaderjavax.xml.stream.XMLStreamExceptionpublic final void require(int type,
String namespaceURI,
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 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 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
public 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 String getNamespaceURI(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 String getAttributeValue(String namespaceURI, String localName)
getAttributeValue in interface javax.xml.stream.XMLStreamReaderpublic final int getAttributeCount()
getAttributeCount in interface javax.xml.stream.XMLStreamReaderpublic final QName getAttributeName(int index)
getAttributeName in interface javax.xml.stream.XMLStreamReaderpublic final String getAttributeNamespace(int index)
getAttributeNamespace in interface javax.xml.stream.XMLStreamReaderpublic final String getAttributeLocalName(int index)
getAttributeLocalName in interface javax.xml.stream.XMLStreamReaderpublic final String getAttributePrefix(int index)
getAttributePrefix in interface javax.xml.stream.XMLStreamReaderpublic final String getAttributeType(int index)
getAttributeType in interface javax.xml.stream.XMLStreamReaderpublic final 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 String getNamespacePrefix(int index)
getNamespacePrefix in interface javax.xml.stream.XMLStreamReaderpublic final String getNamespaceURI(int index)
getNamespaceURI in interface javax.xml.stream.XMLStreamReaderpublic final NamespaceContext getNamespaceContext()
getNamespaceContext in interface javax.xml.stream.XMLStreamReaderpublic final int getEventType()
getEventType in interface javax.xml.stream.XMLStreamReaderpublic final 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 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 QName getName()
getName in interface javax.xml.stream.XMLStreamReaderpublic final String getLocalName()
getLocalName in interface javax.xml.stream.XMLStreamReaderpublic final boolean hasName()
hasName in interface javax.xml.stream.XMLStreamReaderpublic final String getNamespaceURI()
getNamespaceURI in interface javax.xml.stream.XMLStreamReaderpublic final String getPrefix()
getPrefix in interface javax.xml.stream.XMLStreamReaderpublic final 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 String getCharacterEncodingScheme()
getCharacterEncodingScheme in interface javax.xml.stream.XMLStreamReaderpublic final String getPITarget()
getPITarget in interface javax.xml.stream.XMLStreamReaderpublic final String getPIData()
getPIData in interface javax.xml.stream.XMLStreamReaderpublic final String getNameString()
public final String getAttributeNameString(int index)
public final 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
public 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 String accessLocalName()
accessLocalName in interface FastInfosetStreamReaderpublic final String accessNamespaceURI()
accessNamespaceURI in interface FastInfosetStreamReaderpublic final 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,
IOException
FastInfosetExceptionIOExceptionprotected final void processDIIOptionalProperties(int b)
throws FastInfosetException,
IOException
FastInfosetExceptionIOExceptionprotected final void resizeNamespaceAIIs()
protected final void processEIIWithNamespaces(boolean hasAttributes)
throws FastInfosetException,
IOException
FastInfosetExceptionIOExceptionprotected final void processEII(QualifiedName name, boolean hasAttributes) throws FastInfosetException, IOException
FastInfosetExceptionIOExceptionprotected final void processAIIs()
throws FastInfosetException,
IOException
FastInfosetExceptionIOExceptionprotected final QualifiedName processEIIIndexMedium(int b) throws FastInfosetException, IOException
FastInfosetExceptionIOExceptionprotected final QualifiedName processEIIIndexLarge(int b) throws FastInfosetException, IOException
FastInfosetExceptionIOExceptionprotected final QualifiedName processLiteralQualifiedName(int state, QualifiedName q) throws FastInfosetException, IOException
FastInfosetExceptionIOExceptionprotected final void processCommentII()
throws FastInfosetException,
IOException
FastInfosetExceptionIOExceptionprotected final void processProcessingII()
throws FastInfosetException,
IOException
FastInfosetExceptionIOExceptionprotected final void processUnexpandedEntityReference(int b)
throws FastInfosetException,
IOException
FastInfosetExceptionIOExceptionprotected final void processCIIEncodingAlgorithm(boolean addToTable)
throws FastInfosetException,
IOException
FastInfosetExceptionIOExceptionprotected final void processAIIEncodingAlgorithm(QualifiedName name, boolean addToTable) throws FastInfosetException, IOException
FastInfosetExceptionIOExceptionprotected final void convertEncodingAlgorithmDataToCharacters()
throws FastInfosetException,
IOException
FastInfosetExceptionIOExceptionprotected void convertBase64AlorithmDataToCharacters(StringBuffer buffer) throws EncodingAlgorithmException, IOException
public boolean isBase64Follows()
throws IOException
IOExceptionpublic final Iterator getPrefixes()
public final AttributesHolder getAttributesHolder()
public final void setManager(StAXManager manager)
Copyright © 2012 Oracle Corpration. All Rights Reserved.