|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.xml.fastinfoset.Decoder
com.sun.xml.fastinfoset.stax.StAXDocumentParser
public class StAXDocumentParser
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
InputStream.
| Nested Class Summary | |
|---|---|
protected class |
StAXDocumentParser.NamespaceContextImpl
|
| Nested classes/interfaces inherited from class com.sun.xml.fastinfoset.Decoder |
|---|
Decoder.EncodingAlgorithmInputStream |
| Field Summary | |
|---|---|
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
|
| Fields inherited from interface javax.xml.stream.XMLStreamConstants |
|---|
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT |
| Fields inherited from interface org.jvnet.fastinfoset.FastInfosetParser |
|---|
BUFFER_SIZE_PROPERTY, EXTERNAL_VOCABULARIES_PROPERTY, FORCE_STREAM_CLOSE_PROPERTY, REGISTERED_ENCODING_ALGORITHMS_PROPERTY, STRING_INTERNING_PROPERTY |
| Constructor Summary | |
|---|---|
StAXDocumentParser()
|
|
StAXDocumentParser(InputStream s)
|
|
StAXDocumentParser(InputStream s,
StAXManager manager)
|
|
| Method Summary | |
|---|---|
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()
|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected 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
| Constructor Detail |
|---|
public StAXDocumentParser()
public StAXDocumentParser(InputStream s)
public StAXDocumentParser(InputStream s,
StAXManager manager)
| Method Detail |
|---|
public void setInputStream(InputStream s)
Decoder
setInputStream in class Decoders - the InputStream where the fast infoset document is decoded from.public void reset()
Decoder
reset in class Decoderprotected void resetOnError()
public Object getProperty(String name)
throws IllegalArgumentException
getProperty in interface XMLStreamReaderIllegalArgumentException
public int next()
throws XMLStreamException
next in interface XMLStreamReaderXMLStreamException
public final void require(int type,
String namespaceURI,
String localName)
throws XMLStreamException
require in interface XMLStreamReadertype - the event typenamespaceURI - the uri of the event, may be nulllocalName - the localName of the event, may be null
XMLStreamException - if the required values are not matched.
public final String getElementText()
throws XMLStreamException
getElementText in interface XMLStreamReaderXMLStreamException - if the current event is not a START_ELEMENT or if
a non text element is encountered
public final String getElementText(boolean startElementRead)
throws XMLStreamException
startElementRead - flag if start element has already been read
XMLStreamException
public final int nextTag()
throws XMLStreamException
nextTag in interface XMLStreamReaderXMLStreamException - if the current event is not white space
public final int nextTag(boolean currentTagRead)
throws XMLStreamException
XMLStreamException
public final boolean hasNext()
throws XMLStreamException
hasNext in interface XMLStreamReaderXMLStreamException
public void close()
throws XMLStreamException
close in interface XMLStreamReaderXMLStreamExceptionpublic final String getNamespaceURI(String prefix)
getNamespaceURI in interface XMLStreamReaderpublic final boolean isStartElement()
isStartElement in interface XMLStreamReaderpublic final boolean isEndElement()
isEndElement in interface XMLStreamReaderpublic final boolean isCharacters()
isCharacters in interface XMLStreamReaderpublic final boolean isWhiteSpace()
isWhiteSpace in interface XMLStreamReader
public final String getAttributeValue(String namespaceURI,
String localName)
getAttributeValue in interface XMLStreamReaderpublic final int getAttributeCount()
getAttributeCount in interface XMLStreamReaderpublic final QName getAttributeName(int index)
getAttributeName in interface XMLStreamReaderpublic final String getAttributeNamespace(int index)
getAttributeNamespace in interface XMLStreamReaderpublic final String getAttributeLocalName(int index)
getAttributeLocalName in interface XMLStreamReaderpublic final String getAttributePrefix(int index)
getAttributePrefix in interface XMLStreamReaderpublic final String getAttributeType(int index)
getAttributeType in interface XMLStreamReaderpublic final String getAttributeValue(int index)
getAttributeValue in interface XMLStreamReaderpublic final boolean isAttributeSpecified(int index)
isAttributeSpecified in interface XMLStreamReaderpublic final int getNamespaceCount()
getNamespaceCount in interface XMLStreamReaderpublic final String getNamespacePrefix(int index)
getNamespacePrefix in interface XMLStreamReaderpublic final String getNamespaceURI(int index)
getNamespaceURI in interface XMLStreamReaderpublic final NamespaceContext getNamespaceContext()
getNamespaceContext in interface XMLStreamReaderpublic final int getEventType()
getEventType in interface XMLStreamReaderpublic final String getText()
getText in interface XMLStreamReaderpublic final char[] getTextCharacters()
getTextCharacters in interface XMLStreamReaderpublic final int getTextStart()
getTextStart in interface XMLStreamReaderpublic final int getTextLength()
getTextLength in interface XMLStreamReader
public final int getTextCharacters(int sourceStart,
char[] target,
int targetStart,
int length)
throws XMLStreamException
getTextCharacters in interface XMLStreamReaderXMLStreamExceptionprotected final void checkTextState()
public final String getEncoding()
getEncoding in interface XMLStreamReaderpublic final boolean hasText()
hasText in interface XMLStreamReaderpublic final Location getLocation()
getLocation in interface XMLStreamReaderpublic final QName getName()
getName in interface XMLStreamReaderpublic final String getLocalName()
getLocalName in interface XMLStreamReaderpublic final boolean hasName()
hasName in interface XMLStreamReaderpublic final String getNamespaceURI()
getNamespaceURI in interface XMLStreamReaderpublic final String getPrefix()
getPrefix in interface XMLStreamReaderpublic final String getVersion()
getVersion in interface XMLStreamReaderpublic final boolean isStandalone()
isStandalone in interface XMLStreamReaderpublic final boolean standaloneSet()
standaloneSet in interface XMLStreamReaderpublic final String getCharacterEncodingScheme()
getCharacterEncodingScheme in interface XMLStreamReaderpublic final String getPITarget()
getPITarget in interface XMLStreamReaderpublic final String getPIData()
getPIData in interface 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 XMLStreamException
XMLStreamException
public final int peekNext()
throws XMLStreamException
FastInfosetStreamReader
peekNext in interface FastInfosetStreamReader#next.
XMLStreamExceptionpublic void onBeforeOctetBufferOverwrite()
OctetBufferListener
onBeforeOctetBufferOverwrite 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()
FastInfosetStreamReader
accessTextCharacters in interface FastInfosetStreamReaderpublic final int accessTextStart()
accessTextStart in interface FastInfosetStreamReaderpublic final int accessTextLength()
accessTextLength in interface FastInfosetStreamReader
protected final void processDII()
throws FastInfosetException,
IOException
FastInfosetException
IOException
protected final void processDIIOptionalProperties(int b)
throws FastInfosetException,
IOException
FastInfosetException
IOExceptionprotected final void resizeNamespaceAIIs()
protected final void processEIIWithNamespaces(boolean hasAttributes)
throws FastInfosetException,
IOException
FastInfosetException
IOException
protected final void processEII(QualifiedName name,
boolean hasAttributes)
throws FastInfosetException,
IOException
FastInfosetException
IOException
protected final void processAIIs()
throws FastInfosetException,
IOException
FastInfosetException
IOException
protected final QualifiedName processEIIIndexMedium(int b)
throws FastInfosetException,
IOException
FastInfosetException
IOException
protected final QualifiedName processEIIIndexLarge(int b)
throws FastInfosetException,
IOException
FastInfosetException
IOException
protected final QualifiedName processLiteralQualifiedName(int state,
QualifiedName q)
throws FastInfosetException,
IOException
FastInfosetException
IOException
protected final void processCommentII()
throws FastInfosetException,
IOException
FastInfosetException
IOException
protected final void processProcessingII()
throws FastInfosetException,
IOException
FastInfosetException
IOException
protected final void processUnexpandedEntityReference(int b)
throws FastInfosetException,
IOException
FastInfosetException
IOException
protected final void processCIIEncodingAlgorithm(boolean addToTable)
throws FastInfosetException,
IOException
FastInfosetException
IOException
protected final void processAIIEncodingAlgorithm(QualifiedName name,
boolean addToTable)
throws FastInfosetException,
IOException
FastInfosetException
IOException
protected final void convertEncodingAlgorithmDataToCharacters()
throws FastInfosetException,
IOException
FastInfosetException
IOException
protected void convertBase64AlorithmDataToCharacters(StringBuffer buffer)
throws EncodingAlgorithmException,
IOException
EncodingAlgorithmException
IOException
public boolean isBase64Follows()
throws IOException
IOExceptionpublic final String getNamespaceDecl(String prefix)
public final String getURI(String prefix)
public final Iterator getPrefixes()
public final AttributesHolder getAttributesHolder()
public final void setManager(StAXManager manager)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||