public abstract class Stax2ReaderImpl extends Object implements XMLStreamReader2, AttributeInfo, DTDInfo, LocationInfo
XMLStreamReader2,
 the extended stream reader that is part of Stax2.| Modifier and Type | Field and Description | 
|---|---|
protected ValueDecoderFactory | 
_decoderFactory
Factory used for constructing decoders we need for typed access 
 | 
FEATURE_DTD_OVERRIDEATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT| Modifier | Constructor and Description | 
|---|---|
protected  | 
Stax2ReaderImpl()  | 
| Modifier and Type | Method and Description | 
|---|---|
protected TypedXMLStreamException | 
_constructTypeException(IllegalArgumentException iae,
                       String lexicalValue)  | 
protected ValueDecoderFactory | 
_decoderFactory()  | 
void | 
closeCompletely()
Method similar to
  
XMLStreamReader.close(),
 except that this method also does close the underlying input
 source if it has not yet been closed. | 
int | 
findAttributeIndex(String nsURI,
                  String localName)  | 
void | 
getAttributeAs(int index,
              TypedValueDecoder tvd)
Generic access method that can be used for efficient
 decoding of additional types not support natively
 by the typed stream reader. 
 | 
abstract int | 
getAttributeAsArray(int index,
                   TypedArrayDecoder tad)
Actual implementation needs to implement tokenization. 
 | 
abstract byte[] | 
getAttributeAsBinary(Base64Variant v,
                    int index)  | 
byte[] | 
getAttributeAsBinary(int index)
Read an attribute value as a byte array. 
 | 
boolean | 
getAttributeAsBoolean(int index)
Read an attribute value as a boolean. 
 | 
BigDecimal | 
getAttributeAsDecimal(int index)  | 
double | 
getAttributeAsDouble(int index)  | 
double[] | 
getAttributeAsDoubleArray(int index)  | 
float | 
getAttributeAsFloat(int index)  | 
float[] | 
getAttributeAsFloatArray(int index)  | 
int | 
getAttributeAsInt(int index)
Read an attribute value as a boolean. 
 | 
int[] | 
getAttributeAsIntArray(int index)
Read an attribute content as an int array. 
 | 
BigInteger | 
getAttributeAsInteger(int index)  | 
long | 
getAttributeAsLong(int index)
Read an attribute value as a boolean. 
 | 
long[] | 
getAttributeAsLongArray(int index)  | 
QName | 
getAttributeAsQName(int index)  | 
abstract int | 
getAttributeIndex(String namespaceURI,
                 String localName)
Returns the index of the attribute whose local name is 
  
localName and URI is namespaceURI
 or -1 if no such attribute exists. | 
AttributeInfo | 
getAttributeInfo()
Method that can be called to get additional information about
 attributes related to the current start element, as well as
 related DTD-based information if available. 
 | 
abstract XMLStreamLocation2 | 
getCurrentLocation()
A method that returns the current location of the stream reader
 at the input source. 
 | 
abstract int | 
getDepth()
Method that returns the number of open elements in the stack; 0 when
 the reader is in prolog/epilog, 1 inside root element (including
 when pointing at the root element itself) and so on. 
 | 
DTDInfo | 
getDTDInfo()
Method that can be called to get information about DOCTYPE declaration
 that the reader is currently pointing to, if the reader has parsed
 it. 
 | 
String | 
getDTDInternalSubset()  | 
String | 
getDTDPublicId()  | 
String | 
getDTDRootName()  | 
String | 
getDTDSystemId()  | 
void | 
getElementAs(TypedValueDecoder tvd)
Generic decoding method that can be used for efficient
 decoding of additional types not support natively
 by the typed stream reader. 
 | 
byte[] | 
getElementAsBinary()
Convenience method that can be used similar to read binary content
 instead of
  
TypedXMLStreamReader.readElementAsBinary(byte[], int, int, org.codehaus.stax2.typed.Base64Variant), in cases where neither performance nor
 memory usage is a big concern. | 
abstract byte[] | 
getElementAsBinary(Base64Variant v)
Convenience method that can be used similar to read binary content
 instead of
  
TypedXMLStreamReader.readElementAsBinary(byte[], int, int, org.codehaus.stax2.typed.Base64Variant), in cases where neither performance nor
 memory usage is a big concern. | 
boolean | 
getElementAsBoolean()
Read an element content as a boolean. 
 | 
BigDecimal | 
getElementAsDecimal()  | 
double | 
getElementAsDouble()
Read an element content as a 64-bit floating point value. 
 | 
float | 
getElementAsFloat()
Read an element content as a 32-bit floating point value. 
 | 
int | 
getElementAsInt()
Read an element content as a 32-bit integer. 
 | 
BigInteger | 
getElementAsInteger()  | 
long | 
getElementAsLong()
Read an element content as a 64-bit integer. 
 | 
QName | 
getElementAsQName()  | 
long | 
getEndingByteOffset()
Method that can be used to get exact byte offset (number of bytes
 read from the stream right before getting to this location) in the
 stream that is pointed to by this reader, right after the end
 of the current event. 
 | 
long | 
getEndingCharOffset()
Method that can be used to get exact character offset (number of chars
 read from the stream right before getting to this location) in the
 stream that is pointed to by this reader, right after the end
 of the current event. 
 | 
abstract XMLStreamLocation2 | 
getEndLocation()
An optional method that either returns the location object that points the
 ending position of the current event, or null if implementation
 does not keep track of it (some may return only start location; and
 some no location at all). 
 | 
Object | 
getFeature(String name)
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. 
 | 
int | 
getIdAttributeIndex()
Returns the index of the id attribute (attribute with any name,
 type ID from DTD) of current (start) element, if any. 
 | 
LocationInfo | 
getLocationInfo()
Location information is always accessible, for this reader. 
 | 
abstract NamespaceContext | 
getNonTransientNamespaceContext()
This method returns a namespace context object that contains
 information identical to that returned by
  
XMLStreamReader.getNamespaceContext(),
 but one that is
 not transient. | 
int | 
getNotationAttributeIndex()
Returns the index of the notation attribute (attribute with any name,
 type NOTATION from DTD) of current (start) element, if any. 
 | 
String | 
getPrefixedName()
This method returns "prefix-qualified" name of the current
 element. 
 | 
Object | 
getProcessedDTD()  | 
DTDValidationSchema | 
getProcessedDTDSchema()
Method similar to  
DTDInfo.getProcessedDTD(), but type-safe. | 
long | 
getStartingByteOffset()
Method that can be used to get exact byte offset (number of bytes
 read from the stream right before getting to this location) in the
 stream that is pointed to by this reader, right before the start
 of the current event. 
 | 
long | 
getStartingCharOffset()
Method that can be used to get exact character offset (number of chars
 read from the stream right before getting to this location) in the
 stream that is pointed to by this reader, right before the start
 of the current event. 
 | 
abstract XMLStreamLocation2 | 
getStartLocation()
An optional method that either returns the location object that points the
 starting position of the current event, or null if implementation
 does not keep track of it (some may return only end location; and
 some no location at all). 
 | 
int | 
getText(Writer w,
       boolean preserveContents)
Method similar to  
XMLStreamReader.getText(), except
 that it just uses provided Writer to write all textual content,
 and that it works for wider range of event types. | 
abstract boolean | 
isEmptyElement()
Method that can be used to check whether current START_ELEMENT
 event was created for an empty element (xml short-hand notation
 where one tag implies start and end, ending with "/>"), or not. 
 | 
boolean | 
isPropertySupported(String name)
Method similar to  
XMLInputFactory.isPropertySupported(java.lang.String), used
 to determine whether a property is supported by the Reader
 instance. | 
abstract int | 
readElementAsArray(TypedArrayDecoder dec)
Actual implementation needs to implement tokenization and state
 keeping. 
 | 
abstract int | 
readElementAsBinary(Base64Variant b64variant,
                   byte[] resultBuffer,
                   int offset,
                   int maxLength)  | 
int | 
readElementAsBinary(byte[] resultBuffer,
                   int offset,
                   int maxLength)  | 
int | 
readElementAsDoubleArray(double[] value,
                        int from,
                        int length)  | 
int | 
readElementAsFloatArray(float[] value,
                       int from,
                       int length)  | 
int | 
readElementAsIntArray(int[] value,
                     int from,
                     int length)
Read an element content as an int array. 
 | 
int | 
readElementAsLongArray(long[] value,
                      int from,
                      int length)  | 
void | 
setFeature(String name,
          Object value)
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. 
 | 
boolean | 
setProperty(String name,
           Object value)
Method that can be used to set per-reader properties; a subset of
 properties one can set via matching
  
XMLInputFactory2
 instance. | 
abstract ValidationProblemHandler | 
setValidationProblemHandler(ValidationProblemHandler h)
Method that application can call to define a custom handler for
 validation problems encountered during validation process. 
 | 
void | 
skipElement()
Method that will skip all the contents of the element that the
 stream currently points to. 
 | 
XMLValidator | 
stopValidatingAgainst(XMLValidationSchema schema)
Method that can be called by application to stop validating
 output against a schema, for which  
Validatable.validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema)
 was called earlier. | 
XMLValidator | 
stopValidatingAgainst(XMLValidator validator)
Method that can be called by application to stop validating
 output using specified validator. 
 | 
protected void | 
throwNotStartElem()  | 
protected void | 
throwUnsupported()  | 
XMLValidator | 
validateAgainst(XMLValidationSchema schema)
Method that will construct a  
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
 Validatable.stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidationSchema). | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAttributeAsBinary, readElementAsBinaryclose, getAttributeCount, getAttributeLocalName, getAttributeName, getAttributeNamespace, getAttributePrefix, getAttributeType, getAttributeValue, getAttributeValue, getCharacterEncodingScheme, getElementText, getEncoding, getEventType, getLocalName, getLocation, getName, getNamespaceContext, getNamespaceCount, getNamespacePrefix, getNamespaceURI, getNamespaceURI, getNamespaceURI, getPIData, getPITarget, getPrefix, getProperty, getText, getTextCharacters, getTextCharacters, getTextLength, getTextStart, getVersion, hasName, hasNext, hasText, isAttributeSpecified, isCharacters, isEndElement, isStandalone, isStartElement, isWhiteSpace, next, nextTag, require, standaloneSetgetAttributeCountgetLocationprotected ValueDecoderFactory _decoderFactory
public Object getFeature(String name)
XMLStreamReader2
 Note: although some feature names are shared with
 XMLStreamReader2.setFeature(java.lang.String, java.lang.Object), not all are: some features are read-only,
 some write-only
getFeature in interface XMLStreamReader2name - Name of the feature of which value to getpublic void setFeature(String name, Object value)
XMLStreamReader2
 Note: although some feature names are shared with
 XMLStreamReader2.getFeature(java.lang.String), not all are: some features are read-only,
 some write-only
setFeature in interface XMLStreamReader2name - Name of the feature to setvalue - Value to set feature to.public boolean isPropertySupported(String name)
XMLStreamReader2XMLInputFactory.isPropertySupported(java.lang.String), used
 to determine whether a property is supported by the Reader
 instance. This means that this method may return false
 for some properties that the input factory does support: specifically,
 it should only return true if the value is mutable on per-instance
 basis. False means that either the property is not recognized, or
 is not mutable via reader instance.isPropertySupported in interface XMLStreamReader2public boolean setProperty(String name, Object value)
XMLStreamReader2XMLInputFactory2
 instance. Exactly which methods are mutable is implementation
 specific.setProperty in interface XMLStreamReader2name - Name of the property to setvalue - Value to set property to.public void skipElement()
                 throws XMLStreamException
XMLStreamReader2IllegalStateException
 is thrown); after the call the stream will point to the matching
 END_ELEMENT event, having skipped zero or more intervening events
 for the contents.skipElement in interface XMLStreamReader2XMLStreamExceptionpublic AttributeInfo getAttributeInfo() throws XMLStreamException
XMLStreamReader2IllegalStateException will be thrown.getAttributeInfo in interface XMLStreamReader2XMLStreamExceptionpublic DTDInfo getDTDInfo() throws XMLStreamException
XMLStreamReader2getDTDInfo in interface XMLStreamReader2XMLStreamExceptionpublic final LocationInfo getLocationInfo()
getLocationInfo in interface XMLStreamReader2public int getText(Writer w, boolean preserveContents) throws IOException, XMLStreamException
XMLStreamReader2XMLStreamReader.getText(), except
 that it just uses provided Writer to write all textual content,
 and that it works for wider range of event types.
 For further optimization, it may also be allowed to do true
 pass-through, thus possibly avoiding one temporary copy of the
 data. Finally, note that this method is also guaranteed NOT
 to return fragments, even when coalescing is not enabled and
 a parser is otherwised allowed to return partial segments: this
 requirement is due to there being little benefit in returning
 such short chunks when streaming. Coalescing property is still
 honored normally.
 Method can only be called on states CDATA, CHARACTERS, COMMENT,
 DTD, ENTITY_REFERENCE, SPACE and PROCESSING_INSTRUCTION; if called
 when reader is in another state,
 IllegalStateException will be thrown. Content written
 for elements is same as with XMLStreamReader.getText().
getText in interface XMLStreamReader2w - 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.IOExceptionXMLStreamExceptionpublic abstract int getDepth()
XMLStreamReader2getDepth in interface XMLStreamReader2public abstract boolean isEmptyElement()
                                throws XMLStreamException
XMLStreamReader2
 Note: method may need to read more data to know if the element
 is an empty one, and as such may throw an i/o or parsing exception
 (as XMLStreamException); however, it won't throw exceptions
 for non-START_ELEMENT event types.
isEmptyElement in interface XMLStreamReader2XMLStreamExceptionpublic abstract NamespaceContext getNonTransientNamespaceContext()
XMLStreamReader2XMLStreamReader.getNamespaceContext(),
 but one that is
 not transient. That is, one that will remain valid and unchanged
 after its creation. This allows the namespace context to be used
 independent of its source documents life cycle. One possible use
 case is to use this namespace context for 'initializing' writers
 (especially ones that use repairing mode) with optimal/preferred name
 space bindings.getNonTransientNamespaceContext in interface XMLStreamReader2public String getPrefixedName()
XMLStreamReader2
 Note: implementations are encouraged to provide an implementation
 that would be more efficient than calling getLocalName
 and getPrefix separately, but are not required to do
 so. Nonetheless it is usually at least as efficient (if not more)
 to call this method as to do it fully in calling code.
getPrefixedName in interface XMLStreamReader2public void closeCompletely()
                     throws XMLStreamException
XMLStreamReader2XMLStreamReader.close(),
 except that this method also does close the underlying input
 source if it has not yet been closed. It is generally preferable
 to call this method if the parsing ends in an exception;
 and for some input sources (when passing
 a File or URL for factory
 method) it has to be called as the application does not have
 access to the actually input source (InputStream
 opened from a URL and so on).closeCompletely in interface XMLStreamReader2XMLStreamExceptionpublic int findAttributeIndex(String nsURI, String localName)
findAttributeIndex in interface AttributeInfopublic int getIdAttributeIndex()
AttributeInfogetIdAttributeIndex in interface AttributeInfopublic int getNotationAttributeIndex()
AttributeInfogetNotationAttributeIndex in interface AttributeInfopublic Object getProcessedDTD()
getProcessedDTD in interface DTDInfopublic String getDTDRootName()
getDTDRootName in interface DTDInfopublic String getDTDPublicId()
getDTDPublicId in interface DTDInfopublic String getDTDSystemId()
getDTDSystemId in interface DTDInfopublic String getDTDInternalSubset()
getDTDInternalSubset in interface DTDInfopublic DTDValidationSchema getProcessedDTDSchema()
DTDInfoDTDInfo.getProcessedDTD(), but type-safe. Will
 return the DTD schema instance that was read, if we are in mode
 where it does get read (at least dtd-aware).getProcessedDTDSchema in interface DTDInfopublic long getStartingByteOffset()
LocationInfo
 Note: this value MAY be the same as the one returned by
 LocationInfo.getStartingCharOffset(), but usually only for single-byte
 character streams (Ascii, ISO-Latin).
getStartingByteOffset in interface LocationInfopublic long getStartingCharOffset()
LocationInfo
 Note: this value MAY be the same as the one returned by
 LocationInfo.getStartingByteOffset(); this is the case for single-byte
 character streams (Ascii, ISO-Latin), as well as for streams for
 which byte offset information is not available (Readers, Strings).
getStartingCharOffset in interface LocationInfopublic long getEndingByteOffset()
                         throws XMLStreamException
LocationInfo
 Note: this value MAY be the same as the one returned by
 LocationInfo.getEndingCharOffset(), but usually only for single-byte
 character streams (Ascii, ISO-Latin).
Note: for lazy-loading implementations, calling this method may require the underlying stream to be advanced and contents parsed; this is why it is possible that an exception be thrown.
getEndingByteOffset in interface LocationInfoXMLStreamExceptionpublic long getEndingCharOffset()
                         throws XMLStreamException
LocationInfo
 Note: this value MAY be the same as the one returned by
 LocationInfo.getEndingByteOffset(); this is the case for single-byte
 character streams (Ascii, ISO-Latin), as well as for streams for
 which byte offset information is not available (Readers, Strings).
Note: for lazy-loading implementations, calling this method may require the underlying stream to be advanced and contents parsed; this is why it is possible that an exception be thrown.
getEndingCharOffset in interface LocationInfoXMLStreamExceptionpublic abstract XMLStreamLocation2 getStartLocation()
LocationInfo
 Note: since it is assumed that the start location must either have
 been collected by now, or is not accessible (i.e. implementation
 [always] returns null), no exception is allowed to be throws, as
 no parsing should ever need to be done (unlike with
 LocationInfo.getEndLocation()).
getStartLocation in interface LocationInfopublic abstract XMLStreamLocation2 getCurrentLocation()
LocationInfoSince this location information should always be accessible, no further parsing is to be done, and no exceptions can be thrown.
getCurrentLocation in interface LocationInfopublic abstract XMLStreamLocation2 getEndLocation() throws XMLStreamException
LocationInfoNote: since some implementations may not yet know the end location (esp. ones that do lazy loading), this call may require further parsing. As a result, this method may throw a parsing or I/O errors.
getEndLocation in interface LocationInfoXMLStreamException - If the stream reader had to advance to
  the end of the event (to find the location), it may encounter a
  parsing (or I/O) error; if so, that gets thrownpublic XMLValidator validateAgainst(XMLValidationSchema schema) throws XMLStreamException
ValidatableXMLValidator 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
 Validatable.stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidationSchema).
Note that while this method can be called at any point in output processing, validator instances are not required to be able to handle addition at other points than right before outputting the root element.
validateAgainst in interface ValidatableXMLStreamExceptionpublic XMLValidator stopValidatingAgainst(XMLValidationSchema schema) throws XMLStreamException
ValidatableValidatable.validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema)
 was called earlier.stopValidatingAgainst in interface ValidatableXMLStreamExceptionpublic XMLValidator stopValidatingAgainst(XMLValidator validator) throws XMLStreamException
ValidatableValidatable.validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema).
Note: the specified validator is compared for identity with validators in use, not for equality.
stopValidatingAgainst in interface Validatablevalidator)
   if it was being used for validating current document; null if not.XMLStreamExceptionpublic abstract ValidationProblemHandler setValidationProblemHandler(ValidationProblemHandler h)
ValidatablesetValidationProblemHandler in interface Validatableh - Handler to install, if non null; if null, indicates that
   the default (implementation-specific) handling should be usedpublic boolean getElementAsBoolean()
                            throws XMLStreamException
TypedXMLStreamReaderRead an element content as a boolean. The lexical representation of a boolean is defined by the XML Schema boolean data type. Whitespace MUST be collapsed according to the whiteSpace facet for the XML Schema boolean data type. An exception is thrown if, after whitespace is collapsed, the resulting sequence of characters is not in the lexical space defined by the XML Schema boolean data type. (note: allowed lexical values are canonicals "true" and "false", as well as non-canonical "0" and "1")
These are the pre- and post-conditions of calling this method:
getElementAsBoolean in interface TypedXMLStreamReaderXMLStreamException - If unable to access contentTypedXMLStreamException - If unable to convert the resulting
         character sequence into an XML Schema boolean value.public int getElementAsInt()
                    throws XMLStreamException
TypedXMLStreamReaderRead an element content as a 32-bit integer. The lexical representation of a integer is defined by the XML Schema integer data type. Whitespace MUST be collapsed according to the whiteSpace facet for the XML Schema integer data type. An exception is thrown if, after whitespace is collapsed, the resulting sequence of characters is not in the lexical space defined by the XML Schema integer data type.
These are the pre and post conditions of calling this method:
getElementAsInt in interface TypedXMLStreamReaderXMLStreamException - If unable to access contentTypedXMLStreamException - If unable to convert the resulting
         character sequence into a Java (32-bit) integer.public long getElementAsLong()
                      throws XMLStreamException
TypedXMLStreamReaderRead an element content as a 64-bit integer. The lexical representation of a integer is defined by the XML Schema integer data type. Whitespace MUST be collapsed according to the whiteSpace facet for the XML Schema integer data type. An exception is thrown if, after whitespace is collapsed, the resulting sequence of characters is not in the lexical space defined by the XML Schema integer data type.
These are the pre and post conditions of calling this method:
getElementAsLong in interface TypedXMLStreamReaderXMLStreamException - If unable to access contentTypedXMLStreamException - If unable to convert the resulting
         character sequence into a Java (64-bit) integer.public float getElementAsFloat()
                        throws XMLStreamException
TypedXMLStreamReaderRead an element content as a 32-bit floating point value.
 The lexical representation is defined by the 
 XML Schema float data type. Whitespace MUST be 
 collapsed
 according to the whiteSpace facet for the XML Schema float data type.
 An exception is thrown if, after whitespace is
 collapsed, the resulting sequence of characters is not in 
 the lexical space defined by the XML Schema integer data type.
 Note that valid representations include basic Java textual
 representations, as well as 3 special tokens: "INF", "-INF"
 and "NaN"
 
These are the pre and post conditions of calling this method:
getElementAsFloat in interface TypedXMLStreamReaderXMLStreamException - If unable to access contentTypedXMLStreamException - If unable to convert the resulting
         character sequence into a Java floatpublic double getElementAsDouble()
                          throws XMLStreamException
TypedXMLStreamReaderRead an element content as a 64-bit floating point value.
 The lexical representation is defined by the 
 XML Schema double data type. Whitespace MUST be 
 collapsed
 according to the whiteSpace facet for the XML Schema double data type.
 An exception is thrown if, after whitespace is
 collapsed, the resulting sequence of characters is not in 
 the lexical space defined by the XML Schema integer data type.
 Note that valid representations include basic Java textual
 representations, as well as 3 special tokens: "INF", "-INF"
 and "NaN"
 
These are the pre and post conditions of calling this method:
getElementAsDouble in interface TypedXMLStreamReaderXMLStreamException - If unable to access contentTypedXMLStreamException - If unable to convert the resulting
         character sequence into a Java doublepublic BigInteger getElementAsInteger() throws XMLStreamException
getElementAsInteger in interface TypedXMLStreamReaderXMLStreamExceptionpublic BigDecimal getElementAsDecimal() throws XMLStreamException
getElementAsDecimal in interface TypedXMLStreamReaderXMLStreamExceptionpublic QName getElementAsQName() throws XMLStreamException
getElementAsQName in interface TypedXMLStreamReaderXMLStreamExceptionpublic byte[] getElementAsBinary()
                          throws XMLStreamException
TypedXMLStreamReaderTypedXMLStreamReader.readElementAsBinary(byte[], int, int, org.codehaus.stax2.typed.Base64Variant), in cases where neither performance nor
 memory usage is a big concern.
 Note: base64 variant defaults to Base64Variants.MIME.
getElementAsBinary in interface TypedXMLStreamReaderXMLStreamExceptionTypedXMLStreamReader.readElementAsBinary(byte[], int, int, org.codehaus.stax2.typed.Base64Variant)public abstract byte[] getElementAsBinary(Base64Variant v) throws XMLStreamException
TypedXMLStreamReaderTypedXMLStreamReader.readElementAsBinary(byte[], int, int, org.codehaus.stax2.typed.Base64Variant), in cases where neither performance nor
 memory usage is a big concern.getElementAsBinary in interface TypedXMLStreamReaderv - Base64 variant content is in; needed to decode
   alternative variants ("modified base64")XMLStreamExceptionTypedXMLStreamReader.readElementAsBinary(byte[], int, int, org.codehaus.stax2.typed.Base64Variant)public void getElementAs(TypedValueDecoder tvd) throws XMLStreamException
TypedXMLStreamReaderXMLStreamReader.getElementText(),
 and then call one of decode methods defined in
 TypedValueDecoder. The only difference is that
 passed value will be trimmed: that is, any leading or
 trailing white space will be removed prior to calling
 decode method.
 After the call, passed
 decoder object will have decoded and stored value
 (if succesful) or thrown an exception (if not).
 The main benefit of using this method (over just getting
 all content by calling XMLStreamReader.getElementText()
 is efficiency: the stream reader can efficiently gather all textual
 content necessary and pass it to the decoder, often avoiding
 construction of intemediate Strings.
These are the pre- and post-conditions of calling this method:
Note that caller has to know more specific type of decoder, since the base interface does not specify methods for accessing actual decoded value.
getElementAs in interface TypedXMLStreamReaderXMLStreamExceptionpublic int readElementAsIntArray(int[] value,
                        int from,
                        int length)
                          throws XMLStreamException
TypedXMLStreamReader
    <xs:simpleType name="intArray">
       <xs:list itemType="xs:int"/>
    </xs:simpleType> 
 whose lexical space is a list of space-separated ints.
 Whitespace MUST be 
 collapsed
 according to the whiteSpace facet for the intArray
 type shown above. An exception is thrown if, after whitespace is
 collapsed, the resulting sequence of characters is not in 
 the lexical space defined by the intArray data 
 type.
These are the pre and post conditions of calling this method:
readElementAsIntArray in interface TypedXMLStreamReadervalue - The array in which to copy the ints.from - The index in the array from which copying starts.length - The maximun number of ints to copy. Minimum value
   is 1; others an IllegalArgumentException is thrownlength, but
               at least one if any ints found. If not, -1 is returned
   to signal end of ints to parse.XMLStreamExceptionpublic int readElementAsLongArray(long[] value,
                         int from,
                         int length)
                           throws XMLStreamException
readElementAsLongArray in interface TypedXMLStreamReaderXMLStreamExceptionpublic int readElementAsFloatArray(float[] value,
                          int from,
                          int length)
                            throws XMLStreamException
readElementAsFloatArray in interface TypedXMLStreamReaderXMLStreamExceptionpublic int readElementAsDoubleArray(double[] value,
                           int from,
                           int length)
                             throws XMLStreamException
readElementAsDoubleArray in interface TypedXMLStreamReaderXMLStreamExceptionpublic abstract int readElementAsArray(TypedArrayDecoder dec) throws XMLStreamException
!!! TODO: should be possible to implement completely
readElementAsArray in interface TypedXMLStreamReaderXMLStreamExceptionpublic int readElementAsBinary(byte[] resultBuffer,
                      int offset,
                      int maxLength)
                        throws XMLStreamException
readElementAsBinary in interface TypedXMLStreamReaderXMLStreamExceptionpublic abstract int readElementAsBinary(Base64Variant b64variant, byte[] resultBuffer, int offset, int maxLength) throws XMLStreamException
XMLStreamExceptionpublic abstract int getAttributeIndex(String namespaceURI, String localName)
TypedXMLStreamReaderlocalName and URI is namespaceURI
 or -1 if no such attribute exists.getAttributeIndex in interface TypedXMLStreamReadernamespaceURI - The attribute's namespace URI. Values of
   null and "" are considered the same, i.e. "no namespace"
   (or "empty" namespace)localName - The attribute's local name.-1 if no
          such attribute exists.public boolean getAttributeAsBoolean(int index)
                              throws XMLStreamException
TypedXMLStreamReaderRead an attribute value as a boolean. The lexical representation of a boolean is defined by the XML Schema boolean data type. Whitespace MUST be collapsed according to the whiteSpace facet for the XML Schema boolean data type. An exception is thrown if, after whitespace is collapsed, the resulting sequence of characters is not in the lexical space defined by the XML Schema boolean data type.
getAttributeAsBoolean in interface TypedXMLStreamReaderindex - The attribute's index as returned by TypedXMLStreamReader.getAttributeIndex(String, String)XMLStreamException - If unable to convert the resulting
         character sequence into an XML Schema boolean value.public int getAttributeAsInt(int index)
                      throws XMLStreamException
TypedXMLStreamReaderRead an attribute value as a boolean. The lexical representation of a boolean is defined by the XML Schema integer data type. Whitespace MUST be collapsed according to the whiteSpace facet for the type. An exception is thrown if, after whitespace is collapsed, the resulting sequence of characters is not in the lexical space defined by the XML Schema integer data type.
getAttributeAsInt in interface TypedXMLStreamReaderindex - The attribute's index as returned by TypedXMLStreamReader.getAttributeIndex(String, String)XMLStreamException - If unable to convert the resulting
         character sequence into an XML Schema boolean value.public long getAttributeAsLong(int index)
                        throws XMLStreamException
TypedXMLStreamReaderRead an attribute value as a boolean. The lexical representation of a boolean is defined by the XML Schema long data type. Whitespace MUST be collapsed according to the whiteSpace facet for the type. An exception is thrown if, after whitespace is collapsed, the resulting sequence of characters is not in the lexical space defined by the XML Schema long data type.
getAttributeAsLong in interface TypedXMLStreamReaderindex - The attribute's index as returned by TypedXMLStreamReader.getAttributeIndex(String, String)XMLStreamException - If unable to convert the resulting
         character sequence into an XML Schema boolean value.public float getAttributeAsFloat(int index)
                          throws XMLStreamException
getAttributeAsFloat in interface TypedXMLStreamReaderXMLStreamExceptionpublic double getAttributeAsDouble(int index)
                            throws XMLStreamException
getAttributeAsDouble in interface TypedXMLStreamReaderXMLStreamExceptionpublic BigInteger getAttributeAsInteger(int index) throws XMLStreamException
getAttributeAsInteger in interface TypedXMLStreamReaderXMLStreamExceptionpublic BigDecimal getAttributeAsDecimal(int index) throws XMLStreamException
getAttributeAsDecimal in interface TypedXMLStreamReaderXMLStreamExceptionpublic QName getAttributeAsQName(int index) throws XMLStreamException
getAttributeAsQName in interface TypedXMLStreamReaderXMLStreamExceptionpublic void getAttributeAs(int index,
                  TypedValueDecoder tvd)
                    throws XMLStreamException
TypedXMLStreamReader
 As with TypedXMLStreamReader.getElementAs(org.codehaus.stax2.typed.TypedValueDecoder), value passed to a decode
 method will be trimmed of any leading or trailing white space.
getAttributeAs in interface TypedXMLStreamReaderXMLStreamExceptionpublic int[] getAttributeAsIntArray(int index)
                             throws XMLStreamException
TypedXMLStreamReaderRead an attribute content as an int array. The lexical representation of a int array is defined by the following XML schema type:
    <xs:simpleType name="intArray">
       <xs:list itemType="xs:int"/>
    </xs:simpleType> 
 whose lexical space is a list of space-separated ints.
 Whitespace MUST be 
 collapsed
 according to the whiteSpace facet for the intArray
 type shown above. An exception is thrown if, after whitespace is
 collapsed, the resulting sequence of characters is not in 
 the lexical space defined by the intArray data 
 type.getAttributeAsIntArray in interface TypedXMLStreamReaderindex - The attribute's index as returned by TypedXMLStreamReader.getAttributeIndex(String, String).XMLStreamException - If unable to convert the resulting
         character sequence into an XML Schema boolean value.public long[] getAttributeAsLongArray(int index)
                               throws XMLStreamException
getAttributeAsLongArray in interface TypedXMLStreamReaderXMLStreamExceptionpublic float[] getAttributeAsFloatArray(int index)
                                 throws XMLStreamException
getAttributeAsFloatArray in interface TypedXMLStreamReaderXMLStreamExceptionpublic double[] getAttributeAsDoubleArray(int index)
                                   throws XMLStreamException
getAttributeAsDoubleArray in interface TypedXMLStreamReaderXMLStreamExceptionpublic abstract int getAttributeAsArray(int index,
                      TypedArrayDecoder tad)
                                 throws XMLStreamException
!!! TODO: should be possible to implement completely
getAttributeAsArray in interface TypedXMLStreamReaderXMLStreamExceptionpublic byte[] getAttributeAsBinary(int index)
                            throws XMLStreamException
TypedXMLStreamReadergetAttributeAsBinary in interface TypedXMLStreamReaderindex - The attribute's index as returned by TypedXMLStreamReader.getAttributeIndex(String, String).XMLStreamException - If unable to convert the resulting
         character sequence into an XML Schema boolean value.public abstract byte[] getAttributeAsBinary(Base64Variant v, int index) throws XMLStreamException
XMLStreamExceptionprotected ValueDecoderFactory _decoderFactory()
protected TypedXMLStreamException _constructTypeException(IllegalArgumentException iae, String lexicalValue)
protected void throwUnsupported()
                         throws XMLStreamException
XMLStreamExceptionprotected void throwNotStartElem()
Copyright © 2015 fasterxml.com. All Rights Reserved.