XMLStreamReader implementation.
While the read implements Stax API, most of real work is delegated
to input (and thereby, encoding) specific backend implementations.
| Modifier and Type | Field and Description |
|---|---|
| protected int | _attrCount
If the current event is |
| protected CharArrayBase64Decoder | _base64Decoder
Lazily-constructed decoder object for decoding base64 encoded element binary content. |
| protected final boolean | |
| protected final boolean | |
| protected PName | _currName
Prefixed name associated with the current event, if any. |
| protected int | |
| protected ValueDecoderFactory | _decoderFactory
Factory used for constructing decoders we need for typed access |
| protected PName | _dtdRootName
Prefixed root-name DOCTYPE declaration gave us, if any (note: also serves as a marker to know if we have seen DOCTYPE yet) |
| protected int | _parseState
Main parsing/tokenization state (STATE_xxx) |
| protected final XmlScanner | _scanner
Underlying XML scanner |
| private static final int | |
| private static final int | MASK_GET_TEXT
Bitmask for determining if it's ok to call 'getText' |
| private static final int | MASK_GET_TEXT_WITH_WRITER
This mask is used with Stax2 getText() method (one that takes Writer as an argument): accepts even wider range of event types. |
| private static final int | MASK_GET_TEXT_XXX
Bitmask for determining if it's ok to call 'getTextXXX' methods (not including 'getText' itself) |
| private static final int | |
| private static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected CharArrayBase64Decoder | |
| protected void | _closeScanner(boolean forceStreamClose)
Method called to close scanner, by asking it to release resource it has, and potentially also close the underlying stream. |
| private TypedXMLStreamException | _constructTypeException(IllegalArgumentException
Problem as reported by converter iae, String Lexical value (element content, attribute value)
that could not be converted succesfully. lexicalValue)Method called to wrap or convert given conversion-fail exception
into a full |
| private TypedXMLStreamException | |
| protected XMLStreamException | |
| protected final ValueDecoderFactory | |
| private void | _handleEmptyValue(TypedValueDecoder dec)
Method called to handle value that has empty String as representation. |
| protected void | _reportNonTextEvent(int type)
Helper method called when |
| public final void | close()
Implements javax. Note as per StAX 1.0 specs, this method does NOT close the underlying input reader. |
| public final void | closeCompletely()
Implements org. javax.,
except that this method also does close the underlying input
source if it has not yet been closed.
|
| public static StreamReaderImpl | |
| public final int | findAttributeIndex(String nsURI, String localName)
Implements org. |
| public final void | getAttributeAs(int index, TypedValueDecoder tvd)
Implements org. |
| public final int | Returns: Number of tokens decoded, 0 if none foundImplements org. |
| public final byte[] | getAttributeAsBinary(int
The attribute's index as returned by index)getAttributeIndex(String, String).Implements org. |
| public final byte[] | getAttributeAsBinary(int index, Base64Variant v)
Implements org. |
| public final boolean | getAttributeAsBoolean(int
The attribute's index as returned by index)getAttributeIndex(String, String)Implements org. Read an attribute value as a boolean. |
| public final BigDecimal | getAttributeAsDecimal(int index)
Implements org. |
| public final double | getAttributeAsDouble(int index)
Implements org. |
| public final double[] | |
| public final float | getAttributeAsFloat(int index)
Implements org. |
| public final float[] | |
| public final int | getAttributeAsInt(int
The attribute's index as returned by index)getAttributeIndex(String, String)Implements org. Read an attribute value as a boolean. |
| public final int[] | getAttributeAsIntArray(int
The attribute's index as returned by index)getAttributeIndex(String, String).Implements org. Read an attribute content as an int array. |
| public final BigInteger | getAttributeAsInteger(int index)
Implements org. |
| public final long | getAttributeAsLong(int
The attribute's index as returned by index)getAttributeIndex(String, String)Implements org. Read an attribute value as a boolean. |
| public final long[] | getAttributeAsLongArray(int index)
Implements org. |
| public final QName | getAttributeAsQName(int index)
Implements org. |
| public final int | getAttributeCount()
Implements javax. |
| public final int | getAttributeIndex(String
The attribute's namespace URI. Values of
null and "" are considered the same, i.e. "no namespace"
(or "empty" namespace) namespaceURI, String The attribute's local name. localName)Implements org. localName and URI is namespaceURI
or -1 if no such attribute exists.
|
| public final AttributeInfo | getAttributeInfo()
Implements org. |
| public final String | getAttributeLocalName(int
the position of the attribute index)Implements javax. |
| public final QName | getAttributeName(int
the position of the attribute index)Implements javax. |
| public final String | getAttributeNamespace(int
the position of the attribute index)Implements javax. |
| public final String | getAttributePrefix(int
the position of the attribute index)Implements javax. |
| public final String | getAttributeType(int
the position of the attribute index)Implements javax. |
| public final String | getAttributeValue(int
the position of the attribute index)Implements javax. |
| public final String | getAttributeValue(String
the namespace of the attribute nsURI, String the local name of the attribute, cannot be null localName)Implements javax. |
| public final String | getCharacterEncodingScheme()
Implements javax. |
| public ReaderConfig | |
| public final XMLStreamLocation2 | getCurrentLocation()
Implements org. |
| public final int | Returns: Number of open elements in the stack; 0 when parser is in prolog/epilog, 1 inside root element and so on.Implements org. |
| public final DTDInfo | getDTDInfo()
Implements org. DTDInfo, method can just
return this.
|
| public final String | Returns: Internal subset portion of the DOCTYPE declaration, if any; empty String if noneImplements org. |
| public final String | |
| public final String | |
| public final String | |
| public final void | getElementAs(TypedValueDecoder tvd)
Implements org. |
| public final byte[] | getElementAsBinary()
Implements org. readElementAsBinary, in cases where neither performance nor
memory usage is a big concern.
|
| public final byte[] | getElementAsBinary(Base64Variant
Base64 variant content is in; needed to decode
alternative variants ("modified base64") v)Implements org. readElementAsBinary, in cases where neither performance nor
memory usage is a big concern.
|
| public final boolean | getElementAsBoolean()
Implements org. Read an element content as a boolean. |
| public final BigDecimal | |
| public final double | getElementAsDouble()
Implements org. Read an element content as a 64-bit floating point value. |
| public final float | getElementAsFloat()
Implements org. Read an element content as a 32-bit floating point value. |
| public final int | getElementAsInt()
Implements org. Read an element content as a 32-bit integer. |
| public final BigInteger | |
| public final long | getElementAsLong()
Implements org. Read an element content as a 64-bit integer. |
| public final QName | |
| public final String | getElementText()
Implements javax. Reads the content of a text-only element, an exception is thrown if this is not a text-only element. Regardless of value of javax.xml.stream.isCoalescing this method always returns coalesced content. Precondition: the current event is START_ELEMENT. Postcondition: the current event is the corresponding END_ELEMENT. |
| public final String | getEncoding()
Implements javax. |
| public final long | getEndingByteOffset()
Implements org. |
| public final long | getEndingCharOffset()
Implements org. |
| public final XMLStreamLocation2 | getEndLocation()
Implements org. |
| public final int | getEventType()
Implements javax. |
| public final Object | getFeature(String
Name of the feature of which value to get name)Implements org.
Deprecated
Method that can be used to get per-reader values; both generic
ones (names for which are defined as constants in this class),
and implementation dependant ones.
|
| public final int | getIdAttributeIndex()
Implements org. |
| protected Location | |
| public final String | getLocalName()
Implements javax. |
| public final Location | getLocation()
Implements javax. |
| public final LocationInfo | getLocationInfo()
Implements org. |
| public final QName | getName()
Implements javax. |
| public final NamespaceContext | getNamespaceContext()
Implements javax. |
| public final int | getNamespaceCount()
Implements javax. |
| public final String | getNamespacePrefix(int
the position of the namespace declaration index)Implements javax. |
| public final String | getNamespaceURI()
Implements javax. |
| public final String | getNamespaceURI(int
the position of the namespace declaration index)Implements javax. |
| public final String | getNamespaceURI(String
The prefix to lookup, may not be null prefix)Implements javax. |
| public final NamespaceContext | getNonTransientNamespaceContext()
Implements org. javax.,
but one that is
not transient.
|
| public final int | getNotationAttributeIndex()
Implements org. |
| public final String | getPIData()
Implements javax. |
| public final String | getPITarget()
Implements javax. |
| public final String | getPrefix()
Implements javax. |
| public final String | getPrefixedName()
Implements org. |
| public final Object | getProcessedDTD()
Implements org. Note DTD-handling sub-classes need to override this method. |
| public final DTDValidationSchema | getProcessedDTDSchema()
Implements org. |
| public Object | getProperty(String
The name of the property, may not be null name)Implements javax. |
| public XmlScanner | |
| public final long | getStartingByteOffset()
Implements org. |
| public final long | getStartingCharOffset()
Implements org. |
| public final XMLStreamLocation2 | getStartLocation()
Implements org. |
| public final String | getText()
Implements javax. |
| public final int | Returns: Number of characters written to the readerWriter to use for writing textual contents w, boolean If true, reader has to preserve contents
so that further calls to preserveContents)getText will return
proper conntets. If false, reader is allowed to skip creation
of such copies: this can improve performance, but it also means
that further calls to getText is not guaranteed to
return meaningful data.Implements org. getText(), except
that it just uses provided Writer to write all textual content.
|
| public final char[] | getTextCharacters()
Implements javax. |
| public final int | getTextCharacters(int
the index of the first character in the source array to copy srcStart, char[] the destination array target, int the start offset in the target array targetStart, int the number of characters to copy len)Implements javax. |
| public final int | getTextLength()
Implements javax. |
| public final int | getTextStart()
Implements javax. |
| public String | getVersion()
Implements javax. |
| protected int | |
| protected void | |
| public final boolean | hasName()
Implements javax. |
| public final boolean | hasNext()
Implements javax. |
| public final boolean | hasText()
Implements javax. |
| public final boolean | isAttributeSpecified(int
the position of the attribute index)Implements javax. |
| public final boolean | isCharacters()
Implements javax. |
| public final boolean | Returns: True, if cursor points to a start or end element that is constructed from 'empty' element (ends with '/>'); false otherwise.Implements org. |
| public final boolean | isEndElement()
Implements javax. |
| public final boolean | isPropertySupported(String name)
Implements org. javax., used
to determine whether a property is supported by the Reader
instance.
|
| public final boolean | isStandalone()
Implements javax. |
| public final boolean | isStartElement()
Implements javax. |
| public final boolean | isWhiteSpace()
Implements javax. |
| public final int | next()
Implements javax. |
| public final int | nextTag()
Implements javax. |
| public final int | readElementAsArray(TypedArrayDecoder dec)
Implements org. |
| public final int | readElementAsBinary(byte[] resultBuffer, int offset, int maxLength)
Implements org. |
| public final int | readElementAsBinary(byte[]
Array in which to copy decoded bytes. resultBuffer, int Starting offset of the first decoded byte
within result buffer offset, int Maximum number of bytes to decode with this call maxLength, Base64Variant v)Implements org. |
| public final int | readElementAsDoubleArray(double[] value, int from, int length)
Implements org. |
| public final int | readElementAsFloatArray(float[] value, int from, int length)
Implements org. |
| public final int | readElementAsIntArray(int[]
The array in which to copy the ints. value, int The index in the array from which copying starts. from, int The maximun number of ints to copy. Minimum value
is 1; others an length)IllegalArgumentException is thrownImplements org. |
| public final int | readElementAsLongArray(long[] value, int from, int length)
Implements org. |
| protected void | |
| public final void | require(int
the event type type, String the uri of the event, may be null nsUri, String the localName of the event, may be null localName)Implements javax. |
| public final void | setFeature(String
Name of the feature to set name, Object Value to set feature to. value)Implements org.
Deprecated
Method that can be used to set per-reader features such as configuration
settings; both generic
ones (names for which are defined as constants in this class),
and implementation dependant ones.
|
| public final boolean | Returns: True, if the specified property was succesfully set to specified value; false if its value was not changedName of the property to set name, Object Value to set property to. value)Implements org. org.
instance.
|
| public final ValidationProblemHandler | setValidationProblemHandler(ValidationProblemHandler
Handler to install, if non null; if null, indicates that
the default (implementation-specific) handling should be used h)Implements org. |
| public final void | skipElement()
Implements org. |
| public final boolean | standaloneSet()
Implements javax. |
| public final XMLValidator | stopValidatingAgainst(XMLValidationSchema schema)
Implements org. validateAgainst
was called earlier.
|
| public final XMLValidator | stopValidatingAgainst(XMLValidator validator)
Implements org. |
| protected void | |
| private void | |
| private void | |
| protected void | |
| protected void | |
| public final String | |
| public final XMLValidator | validateAgainst(XMLValidationSchema schema)
Implements org. XMLValidator instance from the
given schema (unless a validator for that schema has already been
added),
initialize it if necessary, and make validatable object (reader,
writer)
call appropriate validation methods from this point on until the
end of the document (that is, it's not scoped with sub-trees), or until
validator is removed by an explicit call to
stopValidatingAgainst.
|
| protected QName |