Package com.fasterxml.aalto.stax
Class StreamReaderImpl
java.lang.Object
com.fasterxml.aalto.stax.StreamReaderImpl
- All Implemented Interfaces:
XMLStreamConstants
,XMLStreamReader
,org.codehaus.stax2.AttributeInfo
,org.codehaus.stax2.DTDInfo
,org.codehaus.stax2.LocationInfo
,org.codehaus.stax2.typed.TypedXMLStreamReader
,org.codehaus.stax2.validation.Validatable
,org.codehaus.stax2.XMLStreamReader2
- Direct Known Subclasses:
AsyncStreamReaderImpl
public class StreamReaderImpl
extends Object
implements org.codehaus.stax2.XMLStreamReader2, org.codehaus.stax2.AttributeInfo, org.codehaus.stax2.DTDInfo, org.codehaus.stax2.LocationInfo
Basic backend-independent
XMLStreamReader
implementation.
While the read implements Stax API, most of real work is delegated
to input (and thereby, encoding) specific backend implementations.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
If the current event isSTART_ELEMENT
, number of attributes the start element has.protected org.codehaus.stax2.ri.typed.CharArrayBase64Decoder
Lazily-constructed decoder object for decoding base64 encoded element binary content.protected final boolean
protected final boolean
protected PName
Prefixed name associated with the current event, if any.protected int
protected org.codehaus.stax2.ri.typed.ValueDecoderFactory
Factory used for constructing decoders we need for typed accessprotected PName
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
Main parsing/tokenization state (STATE_xxx)protected final XmlScanner
Underlying XML scannerprivate static final int
private static final int
Bitmask for determining if it's ok to call 'getText'private static final int
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
Bitmask for determining if it's ok to call 'getTextXXX' methods (not including 'getText' itself)private static final int
private static final int
(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final int
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Fields inherited from interface org.codehaus.stax2.XMLStreamReader2
FEATURE_DTD_OVERRIDE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.codehaus.stax2.ri.typed.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 org.codehaus.stax2.typed.TypedXMLStreamException
_constructTypeException
(IllegalArgumentException iae, String lexicalValue) Method called to wrap or convert given conversion-fail exception into a fullTypedXMLStreamException
.private org.codehaus.stax2.typed.TypedXMLStreamException
_constructTypeException
(String msg, String lexicalValue) protected XMLStreamException
_constructUnexpectedInTyped
(int nextToken) protected final org.codehaus.stax2.ri.typed.ValueDecoderFactory
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 whengetElementText()
(et al) method encounters a token type it should not, during text coalescingfinal void
close()
Note: as per StAX 1.0 specs, this method does NOT close the underlying input reader.final void
static StreamReaderImpl
final int
findAttributeIndex
(String nsURI, String localName) final void
getAttributeAs
(int index, org.codehaus.stax2.typed.TypedValueDecoder tvd) final 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.final byte[]
getAttributeAsBinary
(int index) final byte[]
getAttributeAsBinary
(int index, org.codehaus.stax2.typed.Base64Variant v) final boolean
getAttributeAsBoolean
(int index) final BigDecimal
getAttributeAsDecimal
(int index) final double
getAttributeAsDouble
(int index) final double[]
getAttributeAsDoubleArray
(int index) final float
getAttributeAsFloat
(int index) final float[]
getAttributeAsFloatArray
(int index) final int
getAttributeAsInt
(int index) final int[]
getAttributeAsIntArray
(int index) final BigInteger
getAttributeAsInteger
(int index) final long
getAttributeAsLong
(int index) final long[]
getAttributeAsLongArray
(int index) final QName
getAttributeAsQName
(int index) final int
final int
getAttributeIndex
(String namespaceURI, String localName) final org.codehaus.stax2.AttributeInfo
final String
getAttributeLocalName
(int index) final QName
getAttributeName
(int index) final String
getAttributeNamespace
(int index) final String
getAttributePrefix
(int index) final String
getAttributeType
(int index) final String
getAttributeValue
(int index) final String
getAttributeValue
(String nsURI, String localName) final String
As per Stax (1.0) specs, needs to return whatever xml declaration claimed encoding is, if any; or null if no xml declaration found.final org.codehaus.stax2.XMLStreamLocation2
final int
getDepth()
final org.codehaus.stax2.DTDInfo
Since this class implementsDTDInfo
, method can just returnthis
.final String
final String
final String
final String
final void
getElementAs
(org.codehaus.stax2.typed.TypedValueDecoder tvd) final byte[]
final byte[]
getElementAsBinary
(org.codehaus.stax2.typed.Base64Variant v) final boolean
final BigDecimal
final double
final float
final int
final BigInteger
final long
final QName
final String
From StAX specs: Reads the content of a text-only element, an exception is thrown if this is not a text-only element.final String
As per Stax (1.0) specs, needs to return whatever parser determined the encoding was, if it was able to figure it out.final long
final long
final org.codehaus.stax2.XMLStreamLocation2
final int
Returns type of the last event returned; or START_DOCUMENT before any events has been explicitly returned.final Object
getFeature
(String name) Deprecated.final int
protected Location
final String
final Location
final org.codehaus.stax2.LocationInfo
Location information is always accessible, for this reader.final QName
getName()
final NamespaceContext
final int
final String
getNamespacePrefix
(int index) final String
final String
getNamespaceURI
(int index) final String
getNamespaceURI
(String prefix) final NamespaceContext
final int
final String
final String
final String
final String
final Object
Note: DTD-handling sub-classes need to override this method.final org.codehaus.stax2.validation.DTDValidationSchema
Sub-class will override this methodgetProperty
(String name) Should not really be public, but needed by SAX codefinal long
final long
final org.codehaus.stax2.XMLStreamLocation2
final String
getText()
final int
Method similar togetText()
, except that it just uses provided Writer to write all textual content.final char[]
final int
getTextCharacters
(int srcStart, char[] target, int targetStart, int len) final int
final int
protected int
handlePrologEoi
(boolean isProlog) protected void
Method called when hitting an end-of-input within tree, after a valid tokenfinal boolean
hasName()
final boolean
hasNext()
final boolean
hasText()
final boolean
isAttributeSpecified
(int index) final boolean
final boolean
final boolean
final boolean
isPropertySupported
(String name) final boolean
final boolean
final boolean
final int
next()
final int
nextTag()
final int
readElementAsArray
(org.codehaus.stax2.typed.TypedArrayDecoder dec) final int
readElementAsBinary
(byte[] resultBuffer, int offset, int maxLength) final int
readElementAsBinary
(byte[] resultBuffer, int offset, int maxLength, org.codehaus.stax2.typed.Base64Variant v) final int
readElementAsDoubleArray
(double[] value, int from, int length) final int
readElementAsFloatArray
(float[] value, int from, int length) final int
readElementAsIntArray
(int[] value, int from, int length) final int
readElementAsLongArray
(long[] value, int from, int length) protected void
reportInvalidAttrIndex
(int index) final void
final void
setFeature
(String name, Object value) Deprecated.final boolean
setProperty
(String name, Object value) final org.codehaus.stax2.validation.ValidationProblemHandler
setValidationProblemHandler
(org.codehaus.stax2.validation.ValidationProblemHandler h) final void
final boolean
final org.codehaus.stax2.validation.XMLValidator
stopValidatingAgainst
(org.codehaus.stax2.validation.XMLValidationSchema schema) final org.codehaus.stax2.validation.XMLValidator
stopValidatingAgainst
(org.codehaus.stax2.validation.XMLValidator validator) protected void
throwFromIOE
(IOException ioe) private void
throwNotTextual
(int type) private void
throwNotTextXxx
(int type) protected void
throwUnexpectedEOI
(String msg) protected void
Throws generic parse error with specified message and current parsing location.final String
toString()
final org.codehaus.stax2.validation.XMLValidator
validateAgainst
(org.codehaus.stax2.validation.XMLValidationSchema schema) protected QName
verifyQName
(QName n)
-
Field Details
-
STATE_PROLOG
static final int STATE_PROLOG- See Also:
-
STATE_TREE
static final int STATE_TREE- See Also:
-
STATE_EPILOG
static final int STATE_EPILOG- See Also:
-
STATE_CLOSED
static final int STATE_CLOSED- See Also:
-
_scanner
Underlying XML scanner -
_cfgCoalesceText
protected final boolean _cfgCoalesceText -
_cfgReportTextAsChars
protected final boolean _cfgReportTextAsChars -
_currToken
protected int _currToken -
_parseState
protected int _parseStateMain parsing/tokenization state (STATE_xxx) -
_currName
Prefixed name associated with the current event, if any. -
_attrCount
protected int _attrCountIf the current event isSTART_ELEMENT
, number of attributes the start element has. Otherwise undefined. Updated by reader, to make index checks for other attribute access methods simpler. -
_decoderFactory
protected org.codehaus.stax2.ri.typed.ValueDecoderFactory _decoderFactoryFactory used for constructing decoders we need for typed access -
_base64Decoder
protected org.codehaus.stax2.ri.typed.CharArrayBase64Decoder _base64DecoderLazily-constructed decoder object for decoding base64 encoded element binary content. -
_dtdRootName
Prefixed root-name DOCTYPE declaration gave us, if any (note: also serves as a marker to know if we have seen DOCTYPE yet) -
MASK_GET_TEXT
private static final int MASK_GET_TEXTBitmask for determining if it's ok to call 'getText'- See Also:
-
MASK_GET_TEXT_XXX
private static final int MASK_GET_TEXT_XXXBitmask for determining if it's ok to call 'getTextXXX' methods (not including 'getText' itself)- See Also:
-
MASK_GET_TEXT_WITH_WRITER
private static final int MASK_GET_TEXT_WITH_WRITERThis mask is used with Stax2 getText() method (one that takes Writer as an argument): accepts even wider range of event types.- See Also:
-
MASK_GET_ELEMENT_TEXT
private static final int MASK_GET_ELEMENT_TEXT- See Also:
-
MASK_TYPED_ACCESS_ARRAY
private static final int MASK_TYPED_ACCESS_ARRAY- See Also:
-
MASK_TYPED_ACCESS_BINARY
private static final int MASK_TYPED_ACCESS_BINARY- See Also:
-
-
Constructor Details
-
StreamReaderImpl
-
-
Method Details
-
construct
- Throws:
XMLStreamException
-
getScanner
Should not really be public, but needed by SAX code -
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.Note: method name is rather confusing (compare to
getEncoding()
).- Specified by:
getCharacterEncodingScheme
in interfaceXMLStreamReader
-
getEncoding
As per Stax (1.0) specs, needs to return whatever parser determined the encoding was, if it was able to figure it out. If not (there are cases where this can not be found; specifically when being passed aReader
), it should return null.- Specified by:
getEncoding
in interfaceXMLStreamReader
-
getVersion
- Specified by:
getVersion
in interfaceXMLStreamReader
-
isStandalone
public final boolean isStandalone()- Specified by:
isStandalone
in interfaceXMLStreamReader
-
standaloneSet
public final boolean standaloneSet()- Specified by:
standaloneSet
in interfaceXMLStreamReader
-
getProperty
- Specified by:
getProperty
in interfaceXMLStreamReader
-
getConfig
-
getAttributeCount
public final int getAttributeCount()- Specified by:
getAttributeCount
in interfaceorg.codehaus.stax2.AttributeInfo
- Specified by:
getAttributeCount
in interfaceXMLStreamReader
-
getAttributeLocalName
- Specified by:
getAttributeLocalName
in interfaceXMLStreamReader
-
getAttributeName
- Specified by:
getAttributeName
in interfaceXMLStreamReader
-
getAttributeNamespace
- Specified by:
getAttributeNamespace
in interfaceXMLStreamReader
-
getAttributePrefix
- Specified by:
getAttributePrefix
in interfaceXMLStreamReader
-
getAttributeType
- Specified by:
getAttributeType
in interfaceXMLStreamReader
-
getAttributeValue
- Specified by:
getAttributeValue
in interfaceXMLStreamReader
-
getAttributeValue
- Specified by:
getAttributeValue
in interfaceXMLStreamReader
-
getElementText
From StAX specs: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.- Specified by:
getElementText
in interfaceXMLStreamReader
- Throws:
XMLStreamException
-
getEventType
public final int getEventType()Returns type of the last event returned; or START_DOCUMENT before any events has been explicitly returned.- Specified by:
getEventType
in interfaceXMLStreamReader
-
getLocalName
- Specified by:
getLocalName
in interfaceXMLStreamReader
-
getName
- Specified by:
getName
in interfaceXMLStreamReader
-
getNamespaceContext
- Specified by:
getNamespaceContext
in interfaceXMLStreamReader
-
getNamespaceCount
public final int getNamespaceCount()- Specified by:
getNamespaceCount
in interfaceXMLStreamReader
-
getNamespacePrefix
- Specified by:
getNamespacePrefix
in interfaceXMLStreamReader
-
getNamespaceURI
- Specified by:
getNamespaceURI
in interfaceXMLStreamReader
-
getNamespaceURI
- Specified by:
getNamespaceURI
in interfaceXMLStreamReader
-
getNamespaceURI
- Specified by:
getNamespaceURI
in interfaceXMLStreamReader
-
getPIData
- Specified by:
getPIData
in interfaceXMLStreamReader
-
getPITarget
- Specified by:
getPITarget
in interfaceXMLStreamReader
-
getPrefix
- Specified by:
getPrefix
in interfaceXMLStreamReader
-
getText
- Specified by:
getText
in interfaceXMLStreamReader
-
getTextCharacters
public final char[] getTextCharacters()- Specified by:
getTextCharacters
in interfaceXMLStreamReader
-
getTextCharacters
public final int getTextCharacters(int srcStart, char[] target, int targetStart, int len) - Specified by:
getTextCharacters
in interfaceXMLStreamReader
-
getTextLength
public final int getTextLength()- Specified by:
getTextLength
in interfaceXMLStreamReader
-
getTextStart
public final int getTextStart()- Specified by:
getTextStart
in interfaceXMLStreamReader
-
hasName
public final boolean hasName()- Specified by:
hasName
in interfaceXMLStreamReader
-
hasNext
public final boolean hasNext()- Specified by:
hasNext
in interfaceXMLStreamReader
-
hasText
public final boolean hasText()- Specified by:
hasText
in interfaceXMLStreamReader
-
isAttributeSpecified
public final boolean isAttributeSpecified(int index) - Specified by:
isAttributeSpecified
in interfaceXMLStreamReader
-
isCharacters
public final boolean isCharacters()- Specified by:
isCharacters
in interfaceXMLStreamReader
-
isEndElement
public final boolean isEndElement()- Specified by:
isEndElement
in interfaceXMLStreamReader
-
isStartElement
public final boolean isStartElement()- Specified by:
isStartElement
in interfaceXMLStreamReader
-
isWhiteSpace
public final boolean isWhiteSpace()- Specified by:
isWhiteSpace
in interfaceXMLStreamReader
-
require
- Specified by:
require
in interfaceXMLStreamReader
- Throws:
XMLStreamException
-
next
- Specified by:
next
in interfaceXMLStreamReader
- Throws:
XMLStreamException
-
nextTag
- Specified by:
nextTag
in interfaceXMLStreamReader
- Throws:
XMLStreamException
-
close
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).- Specified by:
close
in interfaceXMLStreamReader
- Throws:
XMLStreamException
-
getLocation
- Specified by:
getLocation
in interfaceorg.codehaus.stax2.LocationInfo
- Specified by:
getLocation
in interfaceXMLStreamReader
-
getElementAsBoolean
- Specified by:
getElementAsBoolean
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getElementAsInt
- Specified by:
getElementAsInt
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getElementAsLong
- Specified by:
getElementAsLong
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getElementAsFloat
- Specified by:
getElementAsFloat
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getElementAsDouble
- Specified by:
getElementAsDouble
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getElementAsInteger
- Specified by:
getElementAsInteger
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getElementAsDecimal
- Specified by:
getElementAsDecimal
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getElementAsQName
- Specified by:
getElementAsQName
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getElementAsBinary
- Specified by:
getElementAsBinary
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getElementAs
public final void getElementAs(org.codehaus.stax2.typed.TypedValueDecoder tvd) throws XMLStreamException - Specified by:
getElementAs
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getElementAsBinary
public final byte[] getElementAsBinary(org.codehaus.stax2.typed.Base64Variant v) throws XMLStreamException - Specified by:
getElementAsBinary
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
readElementAsIntArray
- Specified by:
readElementAsIntArray
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
readElementAsLongArray
public final int readElementAsLongArray(long[] value, int from, int length) throws XMLStreamException - Specified by:
readElementAsLongArray
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
readElementAsFloatArray
public final int readElementAsFloatArray(float[] value, int from, int length) throws XMLStreamException - Specified by:
readElementAsFloatArray
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
readElementAsDoubleArray
public final int readElementAsDoubleArray(double[] value, int from, int length) throws XMLStreamException - Specified by:
readElementAsDoubleArray
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
readElementAsArray
public final int readElementAsArray(org.codehaus.stax2.typed.TypedArrayDecoder dec) throws XMLStreamException - Specified by:
readElementAsArray
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
readElementAsBinary
public final int readElementAsBinary(byte[] resultBuffer, int offset, int maxLength) throws XMLStreamException - Specified by:
readElementAsBinary
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
readElementAsBinary
public final int readElementAsBinary(byte[] resultBuffer, int offset, int maxLength, org.codehaus.stax2.typed.Base64Variant v) throws XMLStreamException - Specified by:
readElementAsBinary
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getAttributeIndex
- Specified by:
getAttributeIndex
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
-
getAttributeAsBoolean
- Specified by:
getAttributeAsBoolean
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getAttributeAsInt
- Specified by:
getAttributeAsInt
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getAttributeAsLong
- Specified by:
getAttributeAsLong
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getAttributeAsFloat
- Specified by:
getAttributeAsFloat
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getAttributeAsDouble
- Specified by:
getAttributeAsDouble
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getAttributeAsInteger
- Specified by:
getAttributeAsInteger
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getAttributeAsDecimal
- Specified by:
getAttributeAsDecimal
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getAttributeAsQName
- Specified by:
getAttributeAsQName
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getAttributeAs
public final void getAttributeAs(int index, org.codehaus.stax2.typed.TypedValueDecoder tvd) throws XMLStreamException - Specified by:
getAttributeAs
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getAttributeAsIntArray
- Specified by:
getAttributeAsIntArray
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getAttributeAsLongArray
- Specified by:
getAttributeAsLongArray
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getAttributeAsFloatArray
- Specified by:
getAttributeAsFloatArray
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getAttributeAsDoubleArray
- Specified by:
getAttributeAsDoubleArray
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getAttributeAsArray
public final int getAttributeAsArray(int index, org.codehaus.stax2.typed.TypedArrayDecoder tad) throws XMLStreamException Method that allows reading contents of an attribute as an array of whitespace-separate tokens, decoded using specified decoder.- Specified by:
getAttributeAsArray
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Returns:
- Number of tokens decoded, 0 if none found
- Throws:
XMLStreamException
-
getAttributeAsBinary
- Specified by:
getAttributeAsBinary
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
getAttributeAsBinary
public final byte[] getAttributeAsBinary(int index, org.codehaus.stax2.typed.Base64Variant v) throws XMLStreamException - Specified by:
getAttributeAsBinary
in interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader
- Throws:
XMLStreamException
-
verifyQName
- Throws:
org.codehaus.stax2.typed.TypedXMLStreamException
-
getFeature
Deprecated.- Specified by:
getFeature
in interfaceorg.codehaus.stax2.XMLStreamReader2
-
setFeature
Deprecated.- Specified by:
setFeature
in interfaceorg.codehaus.stax2.XMLStreamReader2
-
isPropertySupported
- Specified by:
isPropertySupported
in interfaceorg.codehaus.stax2.XMLStreamReader2
-
setProperty
- Specified by:
setProperty
in interfaceorg.codehaus.stax2.XMLStreamReader2
- Parameters:
name
- Name of the property to setvalue
- Value to set property to.- Returns:
- True, if the specified property was succesfully set to specified value; false if its value was not changed
-
skipElement
- Specified by:
skipElement
in interfaceorg.codehaus.stax2.XMLStreamReader2
- Throws:
XMLStreamException
-
getAttributeInfo
- Specified by:
getAttributeInfo
in interfaceorg.codehaus.stax2.XMLStreamReader2
- Throws:
XMLStreamException
-
getDTDInfo
Since this class implementsDTDInfo
, method can just returnthis
.- Specified by:
getDTDInfo
in interfaceorg.codehaus.stax2.XMLStreamReader2
- Throws:
XMLStreamException
-
getLocationInfo
public final org.codehaus.stax2.LocationInfo getLocationInfo()Location information is always accessible, for this reader.- Specified by:
getLocationInfo
in interfaceorg.codehaus.stax2.XMLStreamReader2
-
getText
Method similar togetText()
, 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
- Specified by:
getText
in interfaceorg.codehaus.stax2.XMLStreamReader2
- Parameters:
w
- Writer to use for writing textual contentspreserveContents
- If true, reader has to preserve contents so that further calls togetText
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 togetText
is not guaranteed to return meaningful data.- Returns:
- Number of characters written to the reader
- Throws:
XMLStreamException
-
getDepth
public final int getDepth()- Specified by:
getDepth
in interfaceorg.codehaus.stax2.XMLStreamReader2
- Returns:
- Number of open elements in the stack; 0 when parser is in prolog/epilog, 1 inside root element and so on.
-
isEmptyElement
- Specified by:
isEmptyElement
in interfaceorg.codehaus.stax2.XMLStreamReader2
- Returns:
- True, if cursor points to a start or end element that is constructed from 'empty' element (ends with '/>'); false otherwise.
- Throws:
XMLStreamException
-
getNonTransientNamespaceContext
- Specified by:
getNonTransientNamespaceContext
in interfaceorg.codehaus.stax2.XMLStreamReader2
-
getPrefixedName
- Specified by:
getPrefixedName
in interfaceorg.codehaus.stax2.XMLStreamReader2
-
closeCompletely
- Specified by:
closeCompletely
in interfaceorg.codehaus.stax2.XMLStreamReader2
- Throws:
XMLStreamException
-
getProcessedDTD
Note: DTD-handling sub-classes need to override this method.
- Specified by:
getProcessedDTD
in interfaceorg.codehaus.stax2.DTDInfo
-
getDTDRootName
- Specified by:
getDTDRootName
in interfaceorg.codehaus.stax2.DTDInfo
-
getDTDPublicId
- Specified by:
getDTDPublicId
in interfaceorg.codehaus.stax2.DTDInfo
-
getDTDSystemId
- Specified by:
getDTDSystemId
in interfaceorg.codehaus.stax2.DTDInfo
-
getDTDInternalSubset
- Specified by:
getDTDInternalSubset
in interfaceorg.codehaus.stax2.DTDInfo
- Returns:
- Internal subset portion of the DOCTYPE declaration, if any; empty String if none
-
getProcessedDTDSchema
public final org.codehaus.stax2.validation.DTDValidationSchema getProcessedDTDSchema()Sub-class will override this method- Specified by:
getProcessedDTDSchema
in interfaceorg.codehaus.stax2.DTDInfo
-
getStartingByteOffset
public final long getStartingByteOffset()- Specified by:
getStartingByteOffset
in interfaceorg.codehaus.stax2.LocationInfo
-
getStartingCharOffset
public final long getStartingCharOffset()- Specified by:
getStartingCharOffset
in interfaceorg.codehaus.stax2.LocationInfo
-
getEndingByteOffset
- Specified by:
getEndingByteOffset
in interfaceorg.codehaus.stax2.LocationInfo
- Throws:
XMLStreamException
-
getEndingCharOffset
- Specified by:
getEndingCharOffset
in interfaceorg.codehaus.stax2.LocationInfo
- Throws:
XMLStreamException
-
getStartLocation
public final org.codehaus.stax2.XMLStreamLocation2 getStartLocation()- Specified by:
getStartLocation
in interfaceorg.codehaus.stax2.LocationInfo
-
getEndLocation
- Specified by:
getEndLocation
in interfaceorg.codehaus.stax2.LocationInfo
- Throws:
XMLStreamException
-
getCurrentLocation
public final org.codehaus.stax2.XMLStreamLocation2 getCurrentLocation()- Specified by:
getCurrentLocation
in interfaceorg.codehaus.stax2.LocationInfo
-
findAttributeIndex
- Specified by:
findAttributeIndex
in interfaceorg.codehaus.stax2.AttributeInfo
-
getIdAttributeIndex
public final int getIdAttributeIndex()- Specified by:
getIdAttributeIndex
in interfaceorg.codehaus.stax2.AttributeInfo
-
getNotationAttributeIndex
public final int getNotationAttributeIndex()- Specified by:
getNotationAttributeIndex
in interfaceorg.codehaus.stax2.AttributeInfo
-
validateAgainst
public final org.codehaus.stax2.validation.XMLValidator validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema) throws XMLStreamException - Specified by:
validateAgainst
in interfaceorg.codehaus.stax2.validation.Validatable
- Throws:
XMLStreamException
-
stopValidatingAgainst
public final org.codehaus.stax2.validation.XMLValidator stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema) throws XMLStreamException - Specified by:
stopValidatingAgainst
in interfaceorg.codehaus.stax2.validation.Validatable
- Throws:
XMLStreamException
-
stopValidatingAgainst
public final org.codehaus.stax2.validation.XMLValidator stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidator validator) throws XMLStreamException - Specified by:
stopValidatingAgainst
in interfaceorg.codehaus.stax2.validation.Validatable
- Throws:
XMLStreamException
-
setValidationProblemHandler
public final org.codehaus.stax2.validation.ValidationProblemHandler setValidationProblemHandler(org.codehaus.stax2.validation.ValidationProblemHandler h) - Specified by:
setValidationProblemHandler
in interfaceorg.codehaus.stax2.validation.Validatable
-
_reportNonTextEvent
Helper method called whengetElementText()
(et al) method encounters a token type it should not, during text coalescing- Throws:
XMLStreamException
-
getLastCharLocation
-
handlePrologEoi
- Throws:
XMLStreamException
-
handleTreeEoi
Method called when hitting an end-of-input within tree, after a valid token- Throws:
XMLStreamException
-
throwWfe
Throws generic parse error with specified message and current parsing location.- Throws:
XMLStreamException
-
throwNotTextual
private void throwNotTextual(int type) -
throwNotTextXxx
private void throwNotTextXxx(int type) -
throwFromIOE
- Throws:
XMLStreamException
-
throwUnexpectedEOI
- Throws:
XMLStreamException
-
_constructUnexpectedInTyped
-
_constructTypeException
private org.codehaus.stax2.typed.TypedXMLStreamException _constructTypeException(IllegalArgumentException iae, String lexicalValue) Method called to wrap or convert given conversion-fail exception into a fullTypedXMLStreamException
.- Parameters:
iae
- Problem as reported by converterlexicalValue
- Lexical value (element content, attribute value) that could not be converted succesfully.
-
_constructTypeException
-
reportInvalidAttrIndex
protected void reportInvalidAttrIndex(int index) -
_closeScanner
Method called to close scanner, by asking it to release resource it has, and potentially also close the underlying stream.- Throws:
XMLStreamException
-
_decoderFactory
protected final org.codehaus.stax2.ri.typed.ValueDecoderFactory _decoderFactory() -
_base64Decoder
protected org.codehaus.stax2.ri.typed.CharArrayBase64Decoder _base64Decoder() -
_handleEmptyValue
private void _handleEmptyValue(org.codehaus.stax2.typed.TypedValueDecoder dec) throws XMLStreamException Method called to handle value that has empty String as representation. This will usually either lead to an exception, or parsing to the default value for the type in question (null for nullable types and so on).- Throws:
XMLStreamException
-
toString
-