XMLStreamReader2, the
extended stream reader defined by Stax2 extension, by wrapping
a vanilla Stax 1.0 XMLStreamReader implementation.
Note: the implementation is incomplete as-is, since not all features needed are accessible via basic Stax 1.0 interface. As such, two main use cases for this wrapper are:
| Modifier and Type | Field and Description |
|---|---|
| protected StringBase64Decoder | _base64Decoder
Lazily-constructed decoder object for decoding base64 encoded binary content. |
| protected ValueDecoderFactory | _decoderFactory
Factory used for constructing decoders we need for typed access |
| protected int | _depth
Number of open (start) elements currently. |
| protected String | _typedContent
Content temporarily cached to be used for decoding typed content that is in chunked mode (int/long/float/double arrays, base64 encoded binary data) |
| pack-priv static final int | |
| private static final int | |
| protected static final int |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected StringBase64Decoder | |
| protected 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 |
| protected TypedXMLStreamException | |
| protected ValueDecoderFactory | |
| protected int | |
| private final boolean | checkExpand(TypedArrayDecoder tad)
Internal method used to see if we can expand the buffer that the array decoder has. |
| public void | closeCompletely()
Implements org. javax.,
except that this method also does close the underlying input
source if it has not yet been closed.
|
| public int | findAttributeIndex(String nsURI, String localName)
Implements org. |
| public void | getAttributeAs(int index, TypedValueDecoder tvd)
Implements org. |
| public int | getAttributeAsArray(int index, TypedArrayDecoder tad)
Implements org. |
| public byte[] | getAttributeAsBinary(int
The attribute's index as returned by index)getAttributeIndex(String, String).Implements org. |
| public byte[] | getAttributeAsBinary(int index, Base64Variant v)
Implements org. |
| public boolean | getAttributeAsBoolean(int
The attribute's index as returned by index)getAttributeIndex(String, String)Implements org. Read an attribute value as a boolean. |
| public BigDecimal | getAttributeAsDecimal(int index)
Implements org. |
| public double | getAttributeAsDouble(int index)
Implements org. |
| public double[] | |
| public float | getAttributeAsFloat(int index)
Implements org. |
| public float[] | |
| public int | getAttributeAsInt(int
The attribute's index as returned by index)getAttributeIndex(String, String)Implements org. Read an attribute value as a boolean. |
| public 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 BigInteger | getAttributeAsInteger(int index)
Implements org. |
| public long | getAttributeAsLong(int
The attribute's index as returned by index)getAttributeIndex(String, String)Implements org. Read an attribute value as a boolean. |
| public long[] | getAttributeAsLongArray(int index)
Implements org. |
| public QName | getAttributeAsQName(int index)
Implements org. |
| public 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 AttributeInfo | getAttributeInfo()
Implements org. |
| public XMLStreamLocation2 | getCurrentLocation()
Implements org. |
| public 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 DTDInfo | getDTDInfo()
Implements org. |
| public String | Returns: Internal subset portion of the DOCTYPE declaration, if any; empty String if noneImplements org. |
| public String | |
| public String | |
| public String | |
| public void | getElementAs(TypedValueDecoder tvd)
Implements org. |
| public byte[] | getElementAsBinary()
Implements org. readElementAsBinary, in cases where neither performance nor
memory usage is a big concern.
|
| public 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 boolean | getElementAsBoolean()
Implements org. Read an element content as a boolean. |
| public BigDecimal | |
| public double | getElementAsDouble()
Implements org. Read an element content as a 64-bit floating point value. |
| public float | getElementAsFloat()
Implements org. Read an element content as a 32-bit floating point value. |
| public int | getElementAsInt()
Implements org. Read an element content as a 32-bit integer. |
| public BigInteger | |
| public long | getElementAsLong()
Implements org. Read an element content as a 64-bit integer. |
| public QName | |
| public String | getElementText()
Overrides javax. Implements javax. |
| public long | getEndingByteOffset()
Implements org. |
| public long | getEndingCharOffset()
Implements org. |
| public final XMLStreamLocation2 | getEndLocation()
Implements org. |
| public 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 int | getIdAttributeIndex()
Implements org. |
| public final LocationInfo | getLocationInfo()
Implements org. |
| public NamespaceContext | getNonTransientNamespaceContext()
Implements org. javax.,
but one that is
not transient.
|
| public int | getNotationAttributeIndex()
Implements org. |
| public String | getPrefixedName()
Implements org. |
| public Object | |
| public DTDValidationSchema | getProcessedDTDSchema()
Implements org. getProcessedDTD, but type-safe.
|
| public long | getStartingByteOffset()
Implements org. |
| public long | getStartingCharOffset()
Implements org. |
| public XMLStreamLocation2 | getStartLocation()
Implements org. |
| public int | getText(Writer
Writer 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,
and that it works for wider range of event types.
|
| public boolean | isEmptyElement()
Implements org. |
| public boolean | isPropertySupported(String name)
Implements org. javax., used
to determine whether a property is supported by the Reader
instance.
|
| public int | next()
Overrides javax. Implements javax. |
| public int | readElementAsArray(TypedArrayDecoder tad)
Implements org. |
| public int | readElementAsBinary(byte[] resultBuffer, int offset, int maxLength)
Implements org. |
| public 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 int | readElementAsDoubleArray(double[] value, int from, int length)
Implements org. |
| public int | readElementAsFloatArray(float[] value, int from, int length)
Implements org. |
| public 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 int | readElementAsLongArray(long[] value, int from, int length)
Implements org. |
| public 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 boolean | setProperty(String
Name of the property to set name, Object Value to set property to. value)Implements org. org.
instance.
|
| public 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 void | skipElement()
Implements org. |
| public XMLValidator | stopValidatingAgainst(XMLValidationSchema schema)
Implements org. validateAgainst
was called earlier.
|
| public XMLValidator | stopValidatingAgainst(XMLValidator validator)
Implements org. |
| protected void | |
| protected void | |
| protected void | |
| public 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.
|
| public static XMLStreamReader2 | wrapIfNecessary(XMLStreamReader sr)
Method that should be used to add dynamic support for
|