Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.xml.stream.buffer.stax
Class StreamReaderBufferProcessor

    java.lang.Object
      com.sun.xml.stream.buffer.AbstractCreatorProcessor
          com.sun.xml.stream.buffer.AbstractProcessor
              com.sun.xml.stream.buffer.stax.StreamReaderBufferProcessor

All Implemented Interfaces:
  javax.xml.stream.XMLStreamConstants, javax.xml.stream.XMLStreamReader, org.jvnet.staxex.XMLStreamReaderEx

    public class StreamReaderBufferProcessor

extends AbstractProcessor
implements org.jvnet.staxex.XMLStreamReaderEx

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`.)

Author:
  Paul.Sandoz@Sun.Com, K.Venugopal@sun.com

Field Summary
`protected AttributesHolder` | `_attributeCache` Holder of the attributes.
`protected char[]` | `_characters`
`protected java.lang.CharSequence` | `_charSequence`
`protected int` | `_depth` The element depth that we are in.
`protected int` | `_eventType`
`protected int` | `_namespaceAIIsEnd`
`protected java.lang.String[]` | `_namespaceAIIsNamespaceName`
`protected java.lang.String[]` | `_namespaceAIIsPrefix` Namespace prefixes.
`protected int` | `_namespaceAIIsStart`
`protected com.sun.xml.stream.buffer.stax.StreamReaderBufferProcessor.InternalNamespaceContext` | `_nsCtx`
`protected java.lang.String` | `_piData`
`protected java.lang.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 class com.sun.xml.stream.buffer.AbstractProcessor
`_aiiStateTable, _buffer, _eiiStateTable, _fragmentMode, _niiStateTable, _qNameBuffer, _stringInterningFeature, _treeCount, STATE_ATTRIBUTE_LN, STATE_ATTRIBUTE_LN_OBJECT, STATE_ATTRIBUTE_P_U_LN, STATE_ATTRIBUTE_P_U_LN_OBJECT, STATE_ATTRIBUTE_U_LN, STATE_ATTRIBUTE_U_LN_OBJECT, STATE_ATTRIBUTE_U_LN_QN, STATE_ATTRIBUTE_U_LN_QN_OBJECT, STATE_COMMENT_AS_CHAR_ARRAY_COPY, STATE_COMMENT_AS_CHAR_ARRAY_MEDIUM, STATE_COMMENT_AS_CHAR_ARRAY_SMALL, STATE_COMMENT_AS_STRING, STATE_DOCUMENT, STATE_DOCUMENT_FRAGMENT, STATE_ELEMENT_LN, STATE_ELEMENT_P_U_LN, STATE_ELEMENT_U_LN, STATE_ELEMENT_U_LN_QN, STATE_END, STATE_ILLEGAL, STATE_NAMESPACE_ATTRIBUTE, STATE_NAMESPACE_ATTRIBUTE_P, STATE_NAMESPACE_ATTRIBUTE_P_U, STATE_NAMESPACE_ATTRIBUTE_U, STATE_PROCESSING_INSTRUCTION, STATE_TEXT_AS_CHAR_ARRAY_COPY, STATE_TEXT_AS_CHAR_ARRAY_MEDIUM, STATE_TEXT_AS_CHAR_ARRAY_SMALL, STATE_TEXT_AS_OBJECT, STATE_TEXT_AS_STRING`

Fields inherited from class com.sun.xml.stream.buffer.AbstractCreatorProcessor
`_contentCharactersBuffer, _contentCharactersBufferPtr, _contentObjects, _contentObjectsPtr, _currentContentCharactersBufferFragment, _currentContentObjectFragment, _currentStructureFragment, _currentStructureStringFragment, _structure, _structurePtr, _structureStrings, _structureStringsPtr, CHAR_ARRAY_LENGTH_MEDIUM, CHAR_ARRAY_LENGTH_MEDIUM_SIZE, CHAR_ARRAY_LENGTH_SMALL, CHAR_ARRAY_LENGTH_SMALL_SIZE, CONTENT_TYPE_CHAR_ARRAY, CONTENT_TYPE_CHAR_ARRAY_COPY, CONTENT_TYPE_OBJECT, CONTENT_TYPE_STRING, FLAG_DOCUMENT_FRAGMENT, FLAG_PREFIX, FLAG_QUALIFIED_NAME, FLAG_URI, T_ATTRIBUTE, T_ATTRIBUTE_LN, T_ATTRIBUTE_LN_OBJECT, T_ATTRIBUTE_P_U_LN, T_ATTRIBUTE_P_U_LN_OBJECT, T_ATTRIBUTE_U_LN, T_ATTRIBUTE_U_LN_OBJECT, T_ATTRIBUTE_U_LN_QN, T_ATTRIBUTE_U_LN_QN_OBJECT, T_COMMENT, T_COMMENT_AS_CHAR_ARRAY, T_COMMENT_AS_CHAR_ARRAY_COPY, T_COMMENT_AS_CHAR_ARRAY_MEDIUM, T_COMMENT_AS_CHAR_ARRAY_SMALL, T_COMMENT_AS_STRING, T_DOCUMENT, T_DOCUMENT_FRAGMENT, T_ELEMENT, T_ELEMENT_LN, T_ELEMENT_P_U_LN, T_ELEMENT_U_LN, T_ELEMENT_U_LN_QN, T_END, T_END_OF_BUFFER, T_NAMESPACE_ATTRIBUTE, T_NAMESPACE_ATTRIBUTE_P, T_NAMESPACE_ATTRIBUTE_P_U, T_NAMESPACE_ATTRIBUTE_U, T_PROCESSING_INSTRUCTION, T_TEXT, T_TEXT_AS_CHAR_ARRAY, T_TEXT_AS_CHAR_ARRAY_COPY, T_TEXT_AS_CHAR_ARRAY_MEDIUM, T_TEXT_AS_CHAR_ARRAY_SMALL, T_TEXT_AS_OBJECT, T_TEXT_AS_STRING, T_UNEXPANDED_ENTITY_REFERENCE, TYPE_MASK, VALUE_TYPE_OBJECT, VALUE_TYPE_STRING`

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)`

Method Summary
`void` | `close()`
`int` | `getAttributeCount()`
`java.lang.String` | `getAttributeLocalName(int index)`
`javax.xml.namespace.QName` | `getAttributeName(int index)`
`java.lang.String` | `getAttributeNamespace(int index)`
`java.lang.String` | `getAttributePrefix(int index)`
`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()`
`java.lang.String` | `getElementText(boolean startElementRead)`
`java.lang.String` | `getElementTextTrim()`
`java.lang.String` | `getEncoding()`
`int` | `getEventType()`
`java.lang.String` | `getLocalName()`
`javax.xml.stream.Location` | `getLocation()`
`javax.xml.namespace.QName` | `getName()`
`org.jvnet.staxex.NamespaceContextEx` | `getNamespaceContext()`
`int` | `getNamespaceCount()`
`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.CharSequence` | `getPCDATA()`
`java.lang.String` | `getPIData()`
`java.lang.String` | `getPITarget()`
`java.lang.String` | `getPrefix()`
`java.lang.Object` | `getProperty(java.lang.String name)`
`java.lang.String` | `getText()`
`char[]` | `getTextCharacters()`
`int` | `getTextCharacters(int sourceStart, char[] target, int targetStart, int length)`
`int` | `getTextLength()`
`int` | `getTextStart()`
`java.lang.String` | `getVersion()`
`boolean` | `hasName()`
`boolean` | `hasNext()`
`boolean` | `hasText()`
`boolean` | `isAttributeSpecified(int index)`
`boolean` | `isCharacters()`
`boolean` | `isEndElement()`
`boolean` | `isStandalone()`
`boolean` | `isStartElement()`
`boolean` | `isWhiteSpace()`
`int` | `next()`
`int` | `nextTag()`
`int` | `nextTag(boolean currentTagRead)`
`XMLStreamBuffer` | `nextTagAndMark()` Does `nextTag()` and if the parser moved to a new start tag, returns a `XMLStreamBufferMark` that captures the infoset starting from the newly discovered element.
`protected void` | `processElement(java.lang.String prefix, java.lang.String uri, java.lang.String localName)`
`void` | `require(int type, java.lang.String namespaceURI, java.lang.String localName)`
`void` | `setXMLStreamBuffer(XMLStreamBuffer buffer)`
`boolean` | `standaloneSet()`

Methods inherited from class com.sun.xml.stream.buffer.AbstractProcessor
`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

### _stack

    protected com.sun.xml.stream.buffer.stax.StreamReaderBufferProcessor.ElementStackEntry[] _stack

### _stackTop

    protected com.sun.xml.stream.buffer.stax.StreamReaderBufferProcessor.ElementStackEntry _stackTop

  The top-most active entry of the `_stack`.

### _depth

    protected int _depth

  The element depth that we are in. Used to determine when we are done with a tree.

### _namespaceAIIsPrefix

    protected java.lang.String[] _namespaceAIIsPrefix

  Namespace prefixes. Can be empty but not null.

### _namespaceAIIsNamespaceName

    protected java.lang.String[] _namespaceAIIsNamespaceName

### _namespaceAIIsStart

    protected int _namespaceAIIsStart

### _namespaceAIIsEnd

    protected int _namespaceAIIsEnd

### _nsCtx

    protected com.sun.xml.stream.buffer.stax.StreamReaderBufferProcessor.InternalNamespaceContext _nsCtx

### _eventType

    protected int _eventType

### _attributeCache

    protected AttributesHolder _attributeCache

  Holder of the attributes. Be careful that this follows the SAX convention of using "" instead of null.

### _charSequence

    protected java.lang.CharSequence _charSequence

### _characters

    protected char[] _characters

### _textOffset

    protected int _textOffset

### _textLen

    protected int _textLen

### _piTarget

    protected java.lang.String _piTarget

### _piData

    protected java.lang.String _piData

Constructor Detail

### StreamReaderBufferProcessor

    public StreamReaderBufferProcessor()

### StreamReaderBufferProcessor

    public StreamReaderBufferProcessor(XMLStreamBuffer buffer)
                                throws javax.xml.stream.XMLStreamException

Throws:
  `javax.xml.stream.XMLStreamException`

Method Detail

### setXMLStreamBuffer

    public void setXMLStreamBuffer(XMLStreamBuffer buffer)
                            throws javax.xml.stream.XMLStreamException

  Throws:
    `javax.xml.stream.XMLStreamException`

### nextTagAndMark

    public XMLStreamBuffer nextTagAndMark()
                                   throws javax.xml.stream.XMLStreamException

  Does `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.

  Throws:
    `javax.xml.stream.XMLStreamException`

### getProperty

    public java.lang.Object getProperty(java.lang.String name)

  Specified by:
    `getProperty` in interface `javax.xml.stream.XMLStreamReader`

### next

    public int next()
             throws javax.xml.stream.XMLStreamException

  Specified by:
    `next` in interface `javax.xml.stream.XMLStreamReader`
  Throws:
    `javax.xml.stream.XMLStreamException`

### require

    public final void require(int type,
                              java.lang.String namespaceURI,
                              java.lang.String localName)
                       throws javax.xml.stream.XMLStreamException

  Specified by:
    `require` in interface `javax.xml.stream.XMLStreamReader`
  Throws:
    `javax.xml.stream.XMLStreamException`

### getElementTextTrim

    public final java.lang.String getElementTextTrim()
                                              throws javax.xml.stream.XMLStreamException

  Specified by:
    `getElementTextTrim` in interface `org.jvnet.staxex.XMLStreamReaderEx`
  Throws:
    `javax.xml.stream.XMLStreamException`

### getElementText

    public final java.lang.String getElementText()
                                          throws javax.xml.stream.XMLStreamException

  Specified by:
    `getElementText` in interface `javax.xml.stream.XMLStreamReader`
  Throws:
    `javax.xml.stream.XMLStreamException`

### getElementText

    public final java.lang.String getElementText(boolean startElementRead)
                                          throws javax.xml.stream.XMLStreamException

  Throws:
    `javax.xml.stream.XMLStreamException`

### nextTag

    public final int nextTag()
                      throws javax.xml.stream.XMLStreamException

  Specified by:
    `nextTag` in interface `javax.xml.stream.XMLStreamReader`
  Throws:
    `javax.xml.stream.XMLStreamException`

### nextTag

    public final int nextTag(boolean currentTagRead)
                      throws javax.xml.stream.XMLStreamException

  Throws:
    `javax.xml.stream.XMLStreamException`

### hasNext

    public final boolean hasNext()

  Specified by:
    `hasNext` in interface `javax.xml.stream.XMLStreamReader`

### close

    public void close()
               throws javax.xml.stream.XMLStreamException

  Specified by:
    `close` in interface `javax.xml.stream.XMLStreamReader`
  Throws:
    `javax.xml.stream.XMLStreamException`

### isStartElement

    public final boolean isStartElement()

  Specified by:
    `isStartElement` in interface `javax.xml.stream.XMLStreamReader`

### isEndElement

    public final boolean isEndElement()

  Specified by:
    `isEndElement` in interface `javax.xml.stream.XMLStreamReader`

### isCharacters

    public final boolean isCharacters()

  Specified by:
    `isCharacters` in interface `javax.xml.stream.XMLStreamReader`

### isWhiteSpace

    public final boolean isWhiteSpace()

  Specified by:
    `isWhiteSpace` in interface `javax.xml.stream.XMLStreamReader`

### getAttributeValue

    public final java.lang.String getAttributeValue(java.lang.String namespaceURI,
                                                    java.lang.String localName)

  Specified by:
    `getAttributeValue` in interface `javax.xml.stream.XMLStreamReader`

### getAttributeCount

    public final int getAttributeCount()

  Specified by:
    `getAttributeCount` in interface `javax.xml.stream.XMLStreamReader`

### getAttributeName

    public final javax.xml.namespace.QName getAttributeName(int index)

  Specified by:
    `getAttributeName` in interface `javax.xml.stream.XMLStreamReader`

### getAttributeNamespace

    public final java.lang.String getAttributeNamespace(int index)

  Specified by:
    `getAttributeNamespace` in interface `javax.xml.stream.XMLStreamReader`

### getAttributeLocalName

    public final java.lang.String getAttributeLocalName(int index)

  Specified by:
    `getAttributeLocalName` in interface `javax.xml.stream.XMLStreamReader`

### getAttributePrefix

    public final java.lang.String getAttributePrefix(int index)

  Specified by:
    `getAttributePrefix` in interface `javax.xml.stream.XMLStreamReader`

### getAttributeType

    public final java.lang.String getAttributeType(int index)

  Specified by:
    `getAttributeType` in interface `javax.xml.stream.XMLStreamReader`

### getAttributeValue

    public final java.lang.String getAttributeValue(int index)

  Specified by:
    `getAttributeValue` in interface `javax.xml.stream.XMLStreamReader`

### isAttributeSpecified

    public final boolean isAttributeSpecified(int index)

  Specified by:
    `isAttributeSpecified` in interface `javax.xml.stream.XMLStreamReader`

### getNamespaceCount

    public final int getNamespaceCount()

  Specified by:
    `getNamespaceCount` in interface `javax.xml.stream.XMLStreamReader`

### getNamespacePrefix

    public final java.lang.String getNamespacePrefix(int index)

  Specified by:
    `getNamespacePrefix` in interface `javax.xml.stream.XMLStreamReader`

### getNamespaceURI

    public final java.lang.String getNamespaceURI(int index)

  Specified by:
    `getNamespaceURI` in interface `javax.xml.stream.XMLStreamReader`

### getNamespaceURI

    public final java.lang.String getNamespaceURI(java.lang.String prefix)

  Specified by:
    `getNamespaceURI` in interface `javax.xml.stream.XMLStreamReader`

### getNamespaceContext

    public final org.jvnet.staxex.NamespaceContextEx getNamespaceContext()

  Specified by:
    `getNamespaceContext` in interface `javax.xml.stream.XMLStreamReader`
  Specified by:
    `getNamespaceContext` in interface `org.jvnet.staxex.XMLStreamReaderEx`

### getEventType

    public final int getEventType()

  Specified by:
    `getEventType` in interface `javax.xml.stream.XMLStreamReader`

### getText

    public final java.lang.String getText()

  Specified by:
    `getText` in interface `javax.xml.stream.XMLStreamReader`

### getTextCharacters

    public final char[] getTextCharacters()

  Specified by:
    `getTextCharacters` in interface `javax.xml.stream.XMLStreamReader`

### getTextStart

    public final int getTextStart()

  Specified by:
    `getTextStart` in interface `javax.xml.stream.XMLStreamReader`

### getTextLength

    public final int getTextLength()

  Specified by:
    `getTextLength` in interface `javax.xml.stream.XMLStreamReader`

### getTextCharacters

    public final int getTextCharacters(int sourceStart,
                                       char[] target,
                                       int targetStart,
                                       int length)
                                throws javax.xml.stream.XMLStreamException

  Specified by:
    `getTextCharacters` in interface `javax.xml.stream.XMLStreamReader`
  Throws:
    `javax.xml.stream.XMLStreamException`

### getPCDATA

    public final java.lang.CharSequence getPCDATA()

  Specified by:
    `getPCDATA` in interface `org.jvnet.staxex.XMLStreamReaderEx`

### getEncoding

    public final java.lang.String getEncoding()

  Specified by:
    `getEncoding` in interface `javax.xml.stream.XMLStreamReader`

### hasText

    public final boolean hasText()

  Specified by:
    `hasText` in interface `javax.xml.stream.XMLStreamReader`

### getLocation

    public final javax.xml.stream.Location getLocation()

  Specified by:
    `getLocation` in interface `javax.xml.stream.XMLStreamReader`

### hasName

    public final boolean hasName()

  Specified by:
    `hasName` in interface `javax.xml.stream.XMLStreamReader`

### getName

    public final javax.xml.namespace.QName getName()

  Specified by:
    `getName` in interface `javax.xml.stream.XMLStreamReader`

### getLocalName

    public final java.lang.String getLocalName()

  Specified by:
    `getLocalName` in interface `javax.xml.stream.XMLStreamReader`

### getNamespaceURI

    public final java.lang.String getNamespaceURI()

  Specified by:
    `getNamespaceURI` in interface `javax.xml.stream.XMLStreamReader`

### getPrefix

    public final java.lang.String getPrefix()

  Specified by:
    `getPrefix` in interface `javax.xml.stream.XMLStreamReader`

### getVersion

    public final java.lang.String getVersion()

  Specified by:
    `getVersion` in interface `javax.xml.stream.XMLStreamReader`

### isStandalone

    public final boolean isStandalone()

  Specified by:
    `isStandalone` in interface `javax.xml.stream.XMLStreamReader`

### standaloneSet

    public final boolean standaloneSet()

  Specified by:
    `standaloneSet` in interface `javax.xml.stream.XMLStreamReader`

### getCharacterEncodingScheme

    public final java.lang.String getCharacterEncodingScheme()

  Specified by:
    `getCharacterEncodingScheme` in interface `javax.xml.stream.XMLStreamReader`

### getPITarget

    public final java.lang.String getPITarget()

  Specified by:
    `getPITarget` in interface `javax.xml.stream.XMLStreamReader`

### getPIData

    public final java.lang.String getPIData()

  Specified by:
    `getPIData` in interface `javax.xml.stream.XMLStreamReader`

### processElement

    protected void processElement(java.lang.String prefix,
                                  java.lang.String uri,
                                  java.lang.String localName)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD