|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.xml.stream.buffer.AbstractCreatorProcessor
com.sun.xml.stream.buffer.AbstractProcessor
com.sun.xml.stream.buffer.stax.StreamReaderBufferProcessor
public class StreamReaderBufferProcessor
A processor of a XMLStreamBuffer that reads the XML infoset as
XMLStreamReader.
Because of XMLStreamReader design, this processor always produce
a full document infoset, even if the buffer just contains a fragment.
When XMLStreamBuffer contains a multiple tree (AKA "forest"),
XMLStreamReader will behave as if there are multiple root elements
(so you'll see XMLStreamConstants.START_ELEMENT event where you'd normally expect
XMLStreamConstants.END_DOCUMENT.)
| Field Summary | |
|---|---|
protected AttributesHolder |
_attributeCache
Holder of the attributes. |
protected char[] |
_characters
|
protected CharSequence |
_charSequence
|
protected int |
_depth
The element depth that we are in. |
protected int |
_eventType
|
protected int |
_namespaceAIIsEnd
|
protected String[] |
_namespaceAIIsNamespaceName
|
protected String[] |
_namespaceAIIsPrefix
Namespace prefixes. |
protected com.sun.xml.stream.buffer.stax.StreamReaderBufferProcessor.InternalNamespaceContext |
_nsCtx
|
protected String |
_piData
|
protected String |
_piTarget
|
protected com.sun.xml.stream.buffer.stax.StreamReaderBufferProcessor.ElementStackEntry[] |
_stack
|
protected com.sun.xml.stream.buffer.stax.StreamReaderBufferProcessor.ElementStackEntry |
_stackTop
The top-most active entry of the _stack. |
protected int |
_textLen
|
protected int |
_textOffset
|
| 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 |
| Constructor Summary | |
|---|---|
StreamReaderBufferProcessor()
|
|
StreamReaderBufferProcessor(XMLStreamBuffer buffer)
|
|
| Methods inherited from class com.sun.xml.stream.buffer.AbstractProcessor |
|---|
getAIIState, getEIIState, getNIIState, getPrefixFromQName, getQName, peekStructure, readContentCharactersBuffer, readContentCharactersCopy, readContentObject, readContentString, readEiiState, readStructure, readStructure16, readStructureString, setBuffer, setBuffer |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected com.sun.xml.stream.buffer.stax.StreamReaderBufferProcessor.ElementStackEntry[] _stack
protected com.sun.xml.stream.buffer.stax.StreamReaderBufferProcessor.ElementStackEntry _stackTop
_stack.
protected int _depth
protected String[] _namespaceAIIsPrefix
protected String[] _namespaceAIIsNamespaceName
protected int _namespaceAIIsEnd
protected com.sun.xml.stream.buffer.stax.StreamReaderBufferProcessor.InternalNamespaceContext _nsCtx
protected int _eventType
protected AttributesHolder _attributeCache
protected CharSequence _charSequence
protected char[] _characters
protected int _textOffset
protected int _textLen
protected String _piTarget
protected String _piData
| Constructor Detail |
|---|
public StreamReaderBufferProcessor()
public StreamReaderBufferProcessor(XMLStreamBuffer buffer)
throws XMLStreamException
XMLStreamException| Method Detail |
|---|
public void setXMLStreamBuffer(XMLStreamBuffer buffer)
throws XMLStreamException
XMLStreamException
public XMLStreamBuffer nextTagAndMark()
throws XMLStreamException
nextTag() and if the parser moved to a new start tag,
returns a XMLStreamBufferMark that captures the infoset starting
from the newly discovered element.
(Ideally we should have a method that works against the current position,
but the way the data structure is read makes this somewhat difficult.)
This creates a new XMLStreamBufferMark that shares the underlying
data storage, thus it's fairly efficient.
XMLStreamExceptionpublic Object getProperty(String name)
getProperty in interface XMLStreamReader
public int next()
throws XMLStreamException
next in interface XMLStreamReaderXMLStreamException
public final void require(int type,
String namespaceURI,
String localName)
throws XMLStreamException
require in interface XMLStreamReaderXMLStreamException
public final String getElementTextTrim()
throws XMLStreamException
XMLStreamReaderExXMLStreamReader.getElementText() but trims the leading
and trailing whitespace.
The parser can often do this more efficiently than
getElementText().trim().
getElementTextTrim in interface XMLStreamReaderExXMLStreamExceptionXMLStreamReader.getElementText()
public final String getElementText()
throws XMLStreamException
getElementText in interface XMLStreamReaderXMLStreamException
public final String getElementText(boolean startElementRead)
throws XMLStreamException
XMLStreamException
public final int nextTag()
throws XMLStreamException
nextTag in interface XMLStreamReaderXMLStreamException
public final int nextTag(boolean currentTagRead)
throws XMLStreamException
XMLStreamExceptionpublic final boolean hasNext()
hasNext in interface XMLStreamReader
public void close()
throws XMLStreamException
close in interface XMLStreamReaderXMLStreamExceptionpublic 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 String getNamespaceURI(String prefix)
getNamespaceURI in interface XMLStreamReaderpublic final NamespaceContextEx getNamespaceContext()
XMLStreamReaderEx
getNamespaceContext in interface XMLStreamReadergetNamespaceContext in interface XMLStreamReaderExpublic 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 XMLStreamReaderXMLStreamExceptionpublic final CharSequence getPCDATA()
XMLStreamReaderExXMLStreamReader.getText()
but hides the actual data representation.
getPCDATA in interface XMLStreamReaderExCharSequence that represents the
character infoset items at the current position.
The CharSequence is normally a String,
but can be any other CharSequence implementation.
For binary data, however, use of Base64Data is
recommended (so that the consumer interested in seeing it
as binary data may take advantage of mor efficient
data representation.)
The object returned from this method belongs to the parser,
and its content is guaranteed to be the same only until
the XMLStreamReader.next() method is invoked.
public final String getEncoding()
getEncoding in interface XMLStreamReaderpublic final boolean hasText()
hasText in interface XMLStreamReaderpublic final Location getLocation()
getLocation in interface XMLStreamReaderpublic final boolean hasName()
hasName in interface XMLStreamReaderpublic final QName getName()
getName in interface XMLStreamReaderpublic final String getLocalName()
getLocalName 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 XMLStreamReader
protected void processElement(String prefix,
String uri,
String localName,
boolean inscope)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||