public class StreamReaderImpl
extends java.lang.Object
implements org.codehaus.stax2.XMLStreamReader2, org.codehaus.stax2.AttributeInfo, org.codehaus.stax2.DTDInfo, org.codehaus.stax2.LocationInfo
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
START_ELEMENT , number
of attributes the start element has. |
protected org.codehaus.stax2.ri.typed.CharArrayBase64Decoder |
_base64Decoder
Lazily-constructed decoder object for decoding base64 encoded
element binary content.
|
protected boolean |
_cfgCoalesceText |
protected boolean |
_cfgReportTextAsChars |
protected PName |
_currName
Prefixed name associated with the current event, if any.
|
protected int |
_currToken |
protected org.codehaus.stax2.ri.typed.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 XmlScanner |
_scanner
Underlying XML scanner
|
private static int |
MASK_GET_ELEMENT_TEXT |
private static int |
MASK_GET_TEXT
Bitmask for determining if it's ok to call 'getText'
|
private static 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 int |
MASK_GET_TEXT_XXX
Bitmask for determining if it's ok to call 'getTextXXX' methods
(not including 'getText' itself)
|
private static int |
MASK_TYPED_ACCESS_ARRAY |
private static int |
MASK_TYPED_ACCESS_BINARY |
(package private) static int |
STATE_CLOSED |
(package private) static int |
STATE_EPILOG |
(package private) static int |
STATE_PROLOG |
(package private) static int |
STATE_TREE |
Constructor and Description |
---|
StreamReaderImpl(XmlScanner scanner) |
Modifier and Type | Method and Description |
---|---|
protected org.codehaus.stax2.ri.typed.CharArrayBase64Decoder |
_base64Decoder() |
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 org.codehaus.stax2.typed.TypedXMLStreamException |
_constructTypeException(java.lang.IllegalArgumentException iae,
java.lang.String lexicalValue)
Method called to wrap or convert given conversion-fail exception
into a full
TypedXMLStreamException . |
private org.codehaus.stax2.typed.TypedXMLStreamException |
_constructTypeException(java.lang.String msg,
java.lang.String lexicalValue) |
protected javax.xml.stream.XMLStreamException |
_constructUnexpectedInTyped(int nextToken) |
protected org.codehaus.stax2.ri.typed.ValueDecoderFactory |
_decoderFactory() |
private void |
_handleEmptyValue(org.codehaus.stax2.typed.TypedValueDecoder dec)
Method called to handle value that has empty String
as representation.
|
protected void |
_reportNonTextEvent(int type)
Helper method called when
getElementText() (et al) method encounters
a token type it should not, during text coalescing |
void |
close()
Note: as per StAX 1.0 specs, this method does NOT close the underlying
input reader.
|
void |
closeCompletely() |
static StreamReaderImpl |
construct(InputBootstrapper bs) |
int |
findAttributeIndex(java.lang.String nsURI,
java.lang.String localName) |
void |
getAttributeAs(int index,
org.codehaus.stax2.typed.TypedValueDecoder tvd) |
int |
getAttributeAsArray(int index,
org.codehaus.stax2.typed.TypedArrayDecoder tad)
Method that allows reading contents of an attribute as an array
of whitespace-separate tokens, decoded using specified decoder.
|
byte[] |
getAttributeAsBinary(int index) |
byte[] |
getAttributeAsBinary(int index,
org.codehaus.stax2.typed.Base64Variant v) |
boolean |
getAttributeAsBoolean(int index) |
java.math.BigDecimal |
getAttributeAsDecimal(int index) |
double |
getAttributeAsDouble(int index) |
double[] |
getAttributeAsDoubleArray(int index) |
float |
getAttributeAsFloat(int index) |
float[] |
getAttributeAsFloatArray(int index) |
int |
getAttributeAsInt(int index) |
int[] |
getAttributeAsIntArray(int index) |
java.math.BigInteger |
getAttributeAsInteger(int index) |
long |
getAttributeAsLong(int index) |
long[] |
getAttributeAsLongArray(int index) |
javax.xml.namespace.QName |
getAttributeAsQName(int index) |
int |
getAttributeCount() |
int |
getAttributeIndex(java.lang.String namespaceURI,
java.lang.String localName) |
org.codehaus.stax2.AttributeInfo |
getAttributeInfo() |
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 nsURI,
java.lang.String localName) |
java.lang.String |
getCharacterEncodingScheme()
As per Stax (1.0) specs, needs to return whatever xml declaration
claimed encoding is, if any; or null if no xml declaration found.
|
ReaderConfig |
getConfig() |
org.codehaus.stax2.XMLStreamLocation2 |
getCurrentLocation() |
int |
getDepth() |
org.codehaus.stax2.DTDInfo |
getDTDInfo()
Since this class implements
DTDInfo , method can just
return this . |
java.lang.String |
getDTDInternalSubset() |
java.lang.String |
getDTDPublicId() |
java.lang.String |
getDTDRootName() |
java.lang.String |
getDTDSystemId() |
void |
getElementAs(org.codehaus.stax2.typed.TypedValueDecoder tvd) |
byte[] |
getElementAsBinary() |
byte[] |
getElementAsBinary(org.codehaus.stax2.typed.Base64Variant v) |
boolean |
getElementAsBoolean() |
java.math.BigDecimal |
getElementAsDecimal() |
double |
getElementAsDouble() |
float |
getElementAsFloat() |
int |
getElementAsInt() |
java.math.BigInteger |
getElementAsInteger() |
long |
getElementAsLong() |
javax.xml.namespace.QName |
getElementAsQName() |
java.lang.String |
getElementText()
From StAX specs:
Reads the content of a text-only element, an exception is thrown if
this is not a text-only element.
|
java.lang.String |
getEncoding()
As per Stax (1.0) specs, needs to return whatever parser determined
the encoding was, if it was able to figure it out.
|
long |
getEndingByteOffset() |
long |
getEndingCharOffset() |
org.codehaus.stax2.XMLStreamLocation2 |
getEndLocation() |
int |
getEventType()
Returns type of the last event returned; or START_DOCUMENT before
any events has been explicitly returned.
|
java.lang.Object |
getFeature(java.lang.String name) |
int |
getIdAttributeIndex() |
protected javax.xml.stream.Location |
getLastCharLocation() |
java.lang.String |
getLocalName() |
javax.xml.stream.Location |
getLocation() |
org.codehaus.stax2.LocationInfo |
getLocationInfo()
Location information is always accessible, for this reader.
|
javax.xml.namespace.QName |
getName() |
javax.xml.namespace.NamespaceContext |
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) |
javax.xml.namespace.NamespaceContext |
getNonTransientNamespaceContext() |
int |
getNotationAttributeIndex() |
java.lang.String |
getPIData() |
java.lang.String |
getPITarget() |
java.lang.String |
getPrefix() |
java.lang.String |
getPrefixedName() |
java.lang.Object |
getProcessedDTD()
Note: DTD-handling sub-classes need to override this method.
|
org.codehaus.stax2.validation.DTDValidationSchema |
getProcessedDTDSchema()
Sub-class will override this method
|
java.lang.Object |
getProperty(java.lang.String name) |
XmlScanner |
getScanner()
Should not really be public, but needed by SAX code
|
long |
getStartingByteOffset() |
long |
getStartingCharOffset() |
org.codehaus.stax2.XMLStreamLocation2 |
getStartLocation() |
java.lang.String |
getText() |
int |
getText(java.io.Writer w,
boolean preserveContents)
Method similar to
getText() , except
that it just uses provided Writer to write all textual content. |
char[] |
getTextCharacters() |
int |
getTextCharacters(int srcStart,
char[] target,
int targetStart,
int len) |
int |
getTextLength() |
int |
getTextStart() |
java.lang.String |
getVersion() |
protected int |
handlePrologEoi(boolean isProlog) |
protected void |
handleTreeEoi()
Method called when hitting an end-of-input within tree, after
a valid token
|
boolean |
hasName() |
boolean |
hasNext() |
boolean |
hasText() |
boolean |
isAttributeSpecified(int index) |
boolean |
isCharacters() |
boolean |
isEmptyElement() |
boolean |
isEndElement() |
boolean |
isPropertySupported(java.lang.String name) |
boolean |
isStandalone() |
boolean |
isStartElement() |
boolean |
isWhiteSpace() |
int |
next() |
int |
nextTag() |
int |
readElementAsArray(org.codehaus.stax2.typed.TypedArrayDecoder dec) |
int |
readElementAsBinary(byte[] resultBuffer,
int offset,
int maxLength) |
int |
readElementAsBinary(byte[] resultBuffer,
int offset,
int maxLength,
org.codehaus.stax2.typed.Base64Variant v) |
int |
readElementAsDoubleArray(double[] value,
int from,
int length) |
int |
readElementAsFloatArray(float[] value,
int from,
int length) |
int |
readElementAsIntArray(int[] value,
int from,
int length) |
int |
readElementAsLongArray(long[] value,
int from,
int length) |
protected void |
reportInvalidAttrIndex(int index) |
void |
require(int type,
java.lang.String nsUri,
java.lang.String localName) |
void |
setFeature(java.lang.String name,
java.lang.Object value) |
boolean |
setProperty(java.lang.String name,
java.lang.Object value) |
org.codehaus.stax2.validation.ValidationProblemHandler |
setValidationProblemHandler(org.codehaus.stax2.validation.ValidationProblemHandler h) |
void |
skipElement() |
boolean |
standaloneSet() |
org.codehaus.stax2.validation.XMLValidator |
stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema) |
org.codehaus.stax2.validation.XMLValidator |
stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidator validator) |
protected void |
throwFromIOE(java.io.IOException ioe) |
private void |
throwNotTextual(int type) |
private void |
throwNotTextXxx(int type) |
protected void |
throwUnexpectedEOI(java.lang.String msg) |
protected void |
throwWfe(java.lang.String msg)
Throws generic parse error with specified message and current parsing
location.
|
java.lang.String |
toString() |
org.codehaus.stax2.validation.XMLValidator |
validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema) |
protected javax.xml.namespace.QName |
verifyQName(javax.xml.namespace.QName n) |
static final int STATE_PROLOG
static final int STATE_TREE
static final int STATE_EPILOG
static final int STATE_CLOSED
protected final XmlScanner _scanner
protected final boolean _cfgCoalesceText
protected final boolean _cfgReportTextAsChars
protected int _currToken
protected int _parseState
protected PName _currName
protected int _attrCount
START_ELEMENT
, number
of attributes the start element has. Otherwise undefined.
Updated by reader, to make index checks for other attribute
access methods simpler.protected org.codehaus.stax2.ri.typed.ValueDecoderFactory _decoderFactory
protected org.codehaus.stax2.ri.typed.CharArrayBase64Decoder _base64Decoder
protected PName _dtdRootName
private static final int MASK_GET_TEXT
private static final int MASK_GET_TEXT_XXX
private static final int MASK_GET_TEXT_WITH_WRITER
private static final int MASK_GET_ELEMENT_TEXT
private static final int MASK_TYPED_ACCESS_ARRAY
private static final int MASK_TYPED_ACCESS_BINARY
public StreamReaderImpl(XmlScanner scanner)
public static StreamReaderImpl construct(InputBootstrapper bs) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public XmlScanner getScanner()
public final java.lang.String getCharacterEncodingScheme()
Note: method name is rather confusing (compare to getEncoding()
).
getCharacterEncodingScheme
in interface javax.xml.stream.XMLStreamReader
public final java.lang.String getEncoding()
Reader
), it should return null.getEncoding
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getVersion()
getVersion
in interface javax.xml.stream.XMLStreamReader
public final boolean isStandalone()
isStandalone
in interface javax.xml.stream.XMLStreamReader
public final boolean standaloneSet()
standaloneSet
in interface javax.xml.stream.XMLStreamReader
public java.lang.Object getProperty(java.lang.String name)
getProperty
in interface javax.xml.stream.XMLStreamReader
public ReaderConfig getConfig()
public final int getAttributeCount()
getAttributeCount
in interface javax.xml.stream.XMLStreamReader
getAttributeCount
in interface org.codehaus.stax2.AttributeInfo
public final java.lang.String getAttributeLocalName(int index)
getAttributeLocalName
in interface javax.xml.stream.XMLStreamReader
public final javax.xml.namespace.QName getAttributeName(int index)
getAttributeName
in interface javax.xml.stream.XMLStreamReader
public final java.lang.String getAttributeNamespace(int index)
getAttributeNamespace
in interface javax.xml.stream.XMLStreamReader
public final java.lang.String getAttributePrefix(int index)
getAttributePrefix
in interface javax.xml.stream.XMLStreamReader
public final java.lang.String getAttributeType(int index)
getAttributeType
in interface javax.xml.stream.XMLStreamReader
public final java.lang.String getAttributeValue(int index)
getAttributeValue
in interface javax.xml.stream.XMLStreamReader
public final java.lang.String getAttributeValue(java.lang.String nsURI, java.lang.String localName)
getAttributeValue
in interface javax.xml.stream.XMLStreamReader
public final java.lang.String getElementText() throws javax.xml.stream.XMLStreamException
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.
getElementText
in interface javax.xml.stream.XMLStreamReader
javax.xml.stream.XMLStreamException
public final int getEventType()
getEventType
in interface javax.xml.stream.XMLStreamReader
public final java.lang.String getLocalName()
getLocalName
in interface javax.xml.stream.XMLStreamReader
public final javax.xml.namespace.QName getName()
getName
in interface javax.xml.stream.XMLStreamReader
public final javax.xml.namespace.NamespaceContext getNamespaceContext()
getNamespaceContext
in interface javax.xml.stream.XMLStreamReader
public final int getNamespaceCount()
getNamespaceCount
in interface javax.xml.stream.XMLStreamReader
public final java.lang.String getNamespacePrefix(int index)
getNamespacePrefix
in interface javax.xml.stream.XMLStreamReader
public final java.lang.String getNamespaceURI()
getNamespaceURI
in interface javax.xml.stream.XMLStreamReader
public final java.lang.String getNamespaceURI(int index)
getNamespaceURI
in interface javax.xml.stream.XMLStreamReader
public final java.lang.String getNamespaceURI(java.lang.String prefix)
getNamespaceURI
in interface javax.xml.stream.XMLStreamReader
public final java.lang.String getPIData()
getPIData
in interface javax.xml.stream.XMLStreamReader
public final java.lang.String getPITarget()
getPITarget
in interface javax.xml.stream.XMLStreamReader
public final java.lang.String getPrefix()
getPrefix
in interface javax.xml.stream.XMLStreamReader
public final java.lang.String getText()
getText
in interface javax.xml.stream.XMLStreamReader
public final char[] getTextCharacters()
getTextCharacters
in interface javax.xml.stream.XMLStreamReader
public final int getTextCharacters(int srcStart, char[] target, int targetStart, int len)
getTextCharacters
in interface javax.xml.stream.XMLStreamReader
public final int getTextLength()
getTextLength
in interface javax.xml.stream.XMLStreamReader
public final int getTextStart()
getTextStart
in interface javax.xml.stream.XMLStreamReader
public final boolean hasName()
hasName
in interface javax.xml.stream.XMLStreamReader
public final boolean hasNext()
hasNext
in interface javax.xml.stream.XMLStreamReader
public final boolean hasText()
hasText
in interface javax.xml.stream.XMLStreamReader
public final boolean isAttributeSpecified(int index)
isAttributeSpecified
in interface javax.xml.stream.XMLStreamReader
public final boolean isCharacters()
isCharacters
in interface javax.xml.stream.XMLStreamReader
public final boolean isEndElement()
isEndElement
in interface javax.xml.stream.XMLStreamReader
public final boolean isStartElement()
isStartElement
in interface javax.xml.stream.XMLStreamReader
public final boolean isWhiteSpace()
isWhiteSpace
in interface javax.xml.stream.XMLStreamReader
public final void require(int type, java.lang.String nsUri, java.lang.String localName) throws javax.xml.stream.XMLStreamException
require
in interface javax.xml.stream.XMLStreamReader
javax.xml.stream.XMLStreamException
public final int next() throws javax.xml.stream.XMLStreamException
next
in interface javax.xml.stream.XMLStreamReader
javax.xml.stream.XMLStreamException
public final int nextTag() throws javax.xml.stream.XMLStreamException
nextTag
in interface javax.xml.stream.XMLStreamReader
javax.xml.stream.XMLStreamException
public final void close() throws javax.xml.stream.XMLStreamException
Note: as per StAX 1.0 specs, this method does NOT close the underlying
input reader. (that is, unless the new StAX2 property
org.codehaus.stax2.XMLInputFactory2#P_AUTO_CLOSE_INPUT
is
set to true).
close
in interface javax.xml.stream.XMLStreamReader
javax.xml.stream.XMLStreamException
public final javax.xml.stream.Location getLocation()
getLocation
in interface javax.xml.stream.XMLStreamReader
getLocation
in interface org.codehaus.stax2.LocationInfo
public final boolean getElementAsBoolean() throws javax.xml.stream.XMLStreamException
getElementAsBoolean
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final int getElementAsInt() throws javax.xml.stream.XMLStreamException
getElementAsInt
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final long getElementAsLong() throws javax.xml.stream.XMLStreamException
getElementAsLong
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final float getElementAsFloat() throws javax.xml.stream.XMLStreamException
getElementAsFloat
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final double getElementAsDouble() throws javax.xml.stream.XMLStreamException
getElementAsDouble
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final java.math.BigInteger getElementAsInteger() throws javax.xml.stream.XMLStreamException
getElementAsInteger
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final java.math.BigDecimal getElementAsDecimal() throws javax.xml.stream.XMLStreamException
getElementAsDecimal
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final javax.xml.namespace.QName getElementAsQName() throws javax.xml.stream.XMLStreamException
getElementAsQName
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final byte[] getElementAsBinary() throws javax.xml.stream.XMLStreamException
getElementAsBinary
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final void getElementAs(org.codehaus.stax2.typed.TypedValueDecoder tvd) throws javax.xml.stream.XMLStreamException
getElementAs
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final byte[] getElementAsBinary(org.codehaus.stax2.typed.Base64Variant v) throws javax.xml.stream.XMLStreamException
getElementAsBinary
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final int readElementAsIntArray(int[] value, int from, int length) throws javax.xml.stream.XMLStreamException
readElementAsIntArray
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final int readElementAsLongArray(long[] value, int from, int length) throws javax.xml.stream.XMLStreamException
readElementAsLongArray
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final int readElementAsFloatArray(float[] value, int from, int length) throws javax.xml.stream.XMLStreamException
readElementAsFloatArray
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final int readElementAsDoubleArray(double[] value, int from, int length) throws javax.xml.stream.XMLStreamException
readElementAsDoubleArray
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final int readElementAsArray(org.codehaus.stax2.typed.TypedArrayDecoder dec) throws javax.xml.stream.XMLStreamException
readElementAsArray
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final int readElementAsBinary(byte[] resultBuffer, int offset, int maxLength) throws javax.xml.stream.XMLStreamException
readElementAsBinary
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final int readElementAsBinary(byte[] resultBuffer, int offset, int maxLength, org.codehaus.stax2.typed.Base64Variant v) throws javax.xml.stream.XMLStreamException
readElementAsBinary
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final int getAttributeIndex(java.lang.String namespaceURI, java.lang.String localName)
getAttributeIndex
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
public final boolean getAttributeAsBoolean(int index) throws javax.xml.stream.XMLStreamException
getAttributeAsBoolean
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final int getAttributeAsInt(int index) throws javax.xml.stream.XMLStreamException
getAttributeAsInt
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final long getAttributeAsLong(int index) throws javax.xml.stream.XMLStreamException
getAttributeAsLong
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final float getAttributeAsFloat(int index) throws javax.xml.stream.XMLStreamException
getAttributeAsFloat
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final double getAttributeAsDouble(int index) throws javax.xml.stream.XMLStreamException
getAttributeAsDouble
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final java.math.BigInteger getAttributeAsInteger(int index) throws javax.xml.stream.XMLStreamException
getAttributeAsInteger
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final java.math.BigDecimal getAttributeAsDecimal(int index) throws javax.xml.stream.XMLStreamException
getAttributeAsDecimal
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final javax.xml.namespace.QName getAttributeAsQName(int index) throws javax.xml.stream.XMLStreamException
getAttributeAsQName
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final void getAttributeAs(int index, org.codehaus.stax2.typed.TypedValueDecoder tvd) throws javax.xml.stream.XMLStreamException
getAttributeAs
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final int[] getAttributeAsIntArray(int index) throws javax.xml.stream.XMLStreamException
getAttributeAsIntArray
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final long[] getAttributeAsLongArray(int index) throws javax.xml.stream.XMLStreamException
getAttributeAsLongArray
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final float[] getAttributeAsFloatArray(int index) throws javax.xml.stream.XMLStreamException
getAttributeAsFloatArray
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final double[] getAttributeAsDoubleArray(int index) throws javax.xml.stream.XMLStreamException
getAttributeAsDoubleArray
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final int getAttributeAsArray(int index, org.codehaus.stax2.typed.TypedArrayDecoder tad) throws javax.xml.stream.XMLStreamException
getAttributeAsArray
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final byte[] getAttributeAsBinary(int index) throws javax.xml.stream.XMLStreamException
getAttributeAsBinary
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
public final byte[] getAttributeAsBinary(int index, org.codehaus.stax2.typed.Base64Variant v) throws javax.xml.stream.XMLStreamException
getAttributeAsBinary
in interface org.codehaus.stax2.typed.TypedXMLStreamReader
javax.xml.stream.XMLStreamException
protected javax.xml.namespace.QName verifyQName(javax.xml.namespace.QName n) throws org.codehaus.stax2.typed.TypedXMLStreamException
org.codehaus.stax2.typed.TypedXMLStreamException
public final java.lang.Object getFeature(java.lang.String name)
getFeature
in interface org.codehaus.stax2.XMLStreamReader2
public final void setFeature(java.lang.String name, java.lang.Object value)
setFeature
in interface org.codehaus.stax2.XMLStreamReader2
public final boolean isPropertySupported(java.lang.String name)
isPropertySupported
in interface org.codehaus.stax2.XMLStreamReader2
public final boolean setProperty(java.lang.String name, java.lang.Object value)
setProperty
in interface org.codehaus.stax2.XMLStreamReader2
name
- Name of the property to setvalue
- Value to set property to.public final void skipElement() throws javax.xml.stream.XMLStreamException
skipElement
in interface org.codehaus.stax2.XMLStreamReader2
javax.xml.stream.XMLStreamException
public final org.codehaus.stax2.AttributeInfo getAttributeInfo() throws javax.xml.stream.XMLStreamException
getAttributeInfo
in interface org.codehaus.stax2.XMLStreamReader2
javax.xml.stream.XMLStreamException
public final org.codehaus.stax2.DTDInfo getDTDInfo() throws javax.xml.stream.XMLStreamException
DTDInfo
, method can just
return this
.getDTDInfo
in interface org.codehaus.stax2.XMLStreamReader2
javax.xml.stream.XMLStreamException
public final org.codehaus.stax2.LocationInfo getLocationInfo()
getLocationInfo
in interface org.codehaus.stax2.XMLStreamReader2
public final int getText(java.io.Writer w, boolean preserveContents) throws javax.xml.stream.XMLStreamException
getText()
, except
that it just uses provided Writer to write all textual content.
For further optimization, it may also be allowed to do true
pass-through, thus possibly avoiding one temporary copy of the
data.
TODO: try to optimize to allow completely streaming pass-through: currently will still read all data in memory buffers before outputting
getText
in interface org.codehaus.stax2.XMLStreamReader2
w
- Writer to use for writing textual contentspreserveContents
- If true, reader has to preserve contents
so that further calls to 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.javax.xml.stream.XMLStreamException
public final int getDepth()
getDepth
in interface org.codehaus.stax2.XMLStreamReader2
public final boolean isEmptyElement() throws javax.xml.stream.XMLStreamException
isEmptyElement
in interface org.codehaus.stax2.XMLStreamReader2
javax.xml.stream.XMLStreamException
public final javax.xml.namespace.NamespaceContext getNonTransientNamespaceContext()
getNonTransientNamespaceContext
in interface org.codehaus.stax2.XMLStreamReader2
public final java.lang.String getPrefixedName()
getPrefixedName
in interface org.codehaus.stax2.XMLStreamReader2
public final void closeCompletely() throws javax.xml.stream.XMLStreamException
closeCompletely
in interface org.codehaus.stax2.XMLStreamReader2
javax.xml.stream.XMLStreamException
public final java.lang.Object getProcessedDTD()
Note: DTD-handling sub-classes need to override this method.
getProcessedDTD
in interface org.codehaus.stax2.DTDInfo
public final java.lang.String getDTDRootName()
getDTDRootName
in interface org.codehaus.stax2.DTDInfo
public final java.lang.String getDTDPublicId()
getDTDPublicId
in interface org.codehaus.stax2.DTDInfo
public final java.lang.String getDTDSystemId()
getDTDSystemId
in interface org.codehaus.stax2.DTDInfo
public final java.lang.String getDTDInternalSubset()
getDTDInternalSubset
in interface org.codehaus.stax2.DTDInfo
public final org.codehaus.stax2.validation.DTDValidationSchema getProcessedDTDSchema()
getProcessedDTDSchema
in interface org.codehaus.stax2.DTDInfo
public final long getStartingByteOffset()
getStartingByteOffset
in interface org.codehaus.stax2.LocationInfo
public final long getStartingCharOffset()
getStartingCharOffset
in interface org.codehaus.stax2.LocationInfo
public final long getEndingByteOffset() throws javax.xml.stream.XMLStreamException
getEndingByteOffset
in interface org.codehaus.stax2.LocationInfo
javax.xml.stream.XMLStreamException
public final long getEndingCharOffset() throws javax.xml.stream.XMLStreamException
getEndingCharOffset
in interface org.codehaus.stax2.LocationInfo
javax.xml.stream.XMLStreamException
public final org.codehaus.stax2.XMLStreamLocation2 getStartLocation()
getStartLocation
in interface org.codehaus.stax2.LocationInfo
public final org.codehaus.stax2.XMLStreamLocation2 getEndLocation() throws javax.xml.stream.XMLStreamException
getEndLocation
in interface org.codehaus.stax2.LocationInfo
javax.xml.stream.XMLStreamException
public final org.codehaus.stax2.XMLStreamLocation2 getCurrentLocation()
getCurrentLocation
in interface org.codehaus.stax2.LocationInfo
public final int findAttributeIndex(java.lang.String nsURI, java.lang.String localName)
findAttributeIndex
in interface org.codehaus.stax2.AttributeInfo
public final int getIdAttributeIndex()
getIdAttributeIndex
in interface org.codehaus.stax2.AttributeInfo
public final int getNotationAttributeIndex()
getNotationAttributeIndex
in interface org.codehaus.stax2.AttributeInfo
public final org.codehaus.stax2.validation.XMLValidator validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema) throws javax.xml.stream.XMLStreamException
validateAgainst
in interface org.codehaus.stax2.validation.Validatable
javax.xml.stream.XMLStreamException
public final org.codehaus.stax2.validation.XMLValidator stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema) throws javax.xml.stream.XMLStreamException
stopValidatingAgainst
in interface org.codehaus.stax2.validation.Validatable
javax.xml.stream.XMLStreamException
public final org.codehaus.stax2.validation.XMLValidator stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidator validator) throws javax.xml.stream.XMLStreamException
stopValidatingAgainst
in interface org.codehaus.stax2.validation.Validatable
javax.xml.stream.XMLStreamException
public final org.codehaus.stax2.validation.ValidationProblemHandler setValidationProblemHandler(org.codehaus.stax2.validation.ValidationProblemHandler h)
setValidationProblemHandler
in interface org.codehaus.stax2.validation.Validatable
protected void _reportNonTextEvent(int type) throws javax.xml.stream.XMLStreamException
getElementText()
(et al) method encounters
a token type it should not, during text coalescingjavax.xml.stream.XMLStreamException
protected javax.xml.stream.Location getLastCharLocation()
protected int handlePrologEoi(boolean isProlog) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected void handleTreeEoi() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected void throwWfe(java.lang.String msg) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private void throwNotTextual(int type)
private void throwNotTextXxx(int type)
protected void throwFromIOE(java.io.IOException ioe) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected void throwUnexpectedEOI(java.lang.String msg) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected javax.xml.stream.XMLStreamException _constructUnexpectedInTyped(int nextToken)
private org.codehaus.stax2.typed.TypedXMLStreamException _constructTypeException(java.lang.IllegalArgumentException iae, java.lang.String lexicalValue)
TypedXMLStreamException
.iae
- Problem as reported by converterlexicalValue
- Lexical value (element content, attribute value)
that could not be converted succesfully.private org.codehaus.stax2.typed.TypedXMLStreamException _constructTypeException(java.lang.String msg, java.lang.String lexicalValue)
protected void reportInvalidAttrIndex(int index)
protected void _closeScanner(boolean forceStreamClose) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected final org.codehaus.stax2.ri.typed.ValueDecoderFactory _decoderFactory()
protected org.codehaus.stax2.ri.typed.CharArrayBase64Decoder _base64Decoder()
private void _handleEmptyValue(org.codehaus.stax2.typed.TypedValueDecoder dec) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public final java.lang.String toString()
toString
in class java.lang.Object