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 intIf the current event isSTART_ELEMENT, number of attributes the start element has.protected org.codehaus.stax2.ri.typed.CharArrayBase64DecoderLazily-constructed decoder object for decoding base64 encoded element binary content.protected final booleanprotected final booleanprotected PNamePrefixed name associated with the current event, if any.protected intprotected org.codehaus.stax2.ri.typed.ValueDecoderFactoryFactory used for constructing decoders we need for typed accessprotected PNamePrefixed root-name DOCTYPE declaration gave us, if any (note: also serves as a marker to know if we have seen DOCTYPE yet)protected intMain parsing/tokenization state (STATE_xxx)protected final XmlScannerUnderlying XML scannerprivate static final intprivate static final intBitmask for determining if it's ok to call 'getText'private static final intThis mask is used with Stax2 getText() method (one that takes Writer as an argument): accepts even wider range of event types.private static final intBitmask for determining if it's ok to call 'getTextXXX' methods (not including 'getText' itself)private static final intprivate static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final intFields inherited from interface XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENTFields inherited from interface org.codehaus.stax2.XMLStreamReader2
FEATURE_DTD_OVERRIDE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.codehaus.stax2.ri.typed.CharArrayBase64Decoderprotected 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.ValueDecoderFactoryprivate 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 voidclose()Note: as per StAX 1.0 specs, this method does NOT close the underlying input reader.final voidstatic StreamReaderImplfinal intfindAttributeIndex(String nsURI, String localName) final voidgetAttributeAs(int index, org.codehaus.stax2.typed.TypedValueDecoder tvd) final intgetAttributeAsArray(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 booleangetAttributeAsBoolean(int index) final BigDecimalgetAttributeAsDecimal(int index) final doublegetAttributeAsDouble(int index) final double[]getAttributeAsDoubleArray(int index) final floatgetAttributeAsFloat(int index) final float[]getAttributeAsFloatArray(int index) final intgetAttributeAsInt(int index) final int[]getAttributeAsIntArray(int index) final BigIntegergetAttributeAsInteger(int index) final longgetAttributeAsLong(int index) final long[]getAttributeAsLongArray(int index) final QNamegetAttributeAsQName(int index) final intfinal intgetAttributeIndex(String namespaceURI, String localName) final org.codehaus.stax2.AttributeInfofinal StringgetAttributeLocalName(int index) final QNamegetAttributeName(int index) final StringgetAttributeNamespace(int index) final StringgetAttributePrefix(int index) final StringgetAttributeType(int index) final StringgetAttributeValue(int index) final StringgetAttributeValue(String nsURI, String localName) final StringAs 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.XMLStreamLocation2final intgetDepth()final org.codehaus.stax2.DTDInfoSince this class implementsDTDInfo, method can just returnthis.final Stringfinal Stringfinal Stringfinal Stringfinal voidgetElementAs(org.codehaus.stax2.typed.TypedValueDecoder tvd) final byte[]final byte[]getElementAsBinary(org.codehaus.stax2.typed.Base64Variant v) final booleanfinal BigDecimalfinal doublefinal floatfinal intfinal BigIntegerfinal longfinal QNamefinal StringFrom StAX specs: Reads the content of a text-only element, an exception is thrown if this is not a text-only element.final StringAs per Stax (1.0) specs, needs to return whatever parser determined the encoding was, if it was able to figure it out.final longfinal longfinal org.codehaus.stax2.XMLStreamLocation2final intReturns type of the last event returned; or START_DOCUMENT before any events has been explicitly returned.final ObjectgetFeature(String name) Deprecated.final intprotected Locationfinal Stringfinal Locationfinal org.codehaus.stax2.LocationInfoLocation information is always accessible, for this reader.final QNamegetName()final NamespaceContextfinal intfinal StringgetNamespacePrefix(int index) final Stringfinal StringgetNamespaceURI(int index) final StringgetNamespaceURI(String prefix) final NamespaceContextfinal intfinal Stringfinal Stringfinal Stringfinal Stringfinal ObjectNote: DTD-handling sub-classes need to override this method.final org.codehaus.stax2.validation.DTDValidationSchemaSub-class will override this methodgetProperty(String name) Should not really be public, but needed by SAX codefinal longfinal longfinal org.codehaus.stax2.XMLStreamLocation2final StringgetText()final intMethod similar togetText(), except that it just uses provided Writer to write all textual content.final char[]final intgetTextCharacters(int srcStart, char[] target, int targetStart, int len) final intfinal intprotected inthandlePrologEoi(boolean isProlog) protected voidMethod called when hitting an end-of-input within tree, after a valid tokenfinal booleanhasName()final booleanhasNext()final booleanhasText()final booleanisAttributeSpecified(int index) final booleanfinal booleanfinal booleanfinal booleanisPropertySupported(String name) final booleanfinal booleanfinal booleanfinal intnext()final intnextTag()final intreadElementAsArray(org.codehaus.stax2.typed.TypedArrayDecoder dec) final intreadElementAsBinary(byte[] resultBuffer, int offset, int maxLength) final intreadElementAsBinary(byte[] resultBuffer, int offset, int maxLength, org.codehaus.stax2.typed.Base64Variant v) final intreadElementAsDoubleArray(double[] value, int from, int length) final intreadElementAsFloatArray(float[] value, int from, int length) final intreadElementAsIntArray(int[] value, int from, int length) final intreadElementAsLongArray(long[] value, int from, int length) protected voidreportInvalidAttrIndex(int index) final voidfinal voidsetFeature(String name, Object value) Deprecated.final booleansetProperty(String name, Object value) final org.codehaus.stax2.validation.ValidationProblemHandlersetValidationProblemHandler(org.codehaus.stax2.validation.ValidationProblemHandler h) final voidfinal booleanfinal org.codehaus.stax2.validation.XMLValidatorstopValidatingAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema) final org.codehaus.stax2.validation.XMLValidatorstopValidatingAgainst(org.codehaus.stax2.validation.XMLValidator validator) protected voidthrowFromIOE(IOException ioe) private voidthrowNotTextual(int type) private voidthrowNotTextXxx(int type) protected voidthrowUnexpectedEOI(String msg) protected voidThrows generic parse error with specified message and current parsing location.final StringtoString()final org.codehaus.stax2.validation.XMLValidatorvalidateAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema) protected QNameverifyQName(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:
getCharacterEncodingSchemein 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:
getEncodingin interfaceXMLStreamReader
-
getVersion
- Specified by:
getVersionin interfaceXMLStreamReader
-
isStandalone
public final boolean isStandalone()- Specified by:
isStandalonein interfaceXMLStreamReader
-
standaloneSet
public final boolean standaloneSet()- Specified by:
standaloneSetin interfaceXMLStreamReader
-
getProperty
- Specified by:
getPropertyin interfaceXMLStreamReader
-
getConfig
-
getAttributeCount
public final int getAttributeCount()- Specified by:
getAttributeCountin interfaceorg.codehaus.stax2.AttributeInfo- Specified by:
getAttributeCountin interfaceXMLStreamReader
-
getAttributeLocalName
- Specified by:
getAttributeLocalNamein interfaceXMLStreamReader
-
getAttributeName
- Specified by:
getAttributeNamein interfaceXMLStreamReader
-
getAttributeNamespace
- Specified by:
getAttributeNamespacein interfaceXMLStreamReader
-
getAttributePrefix
- Specified by:
getAttributePrefixin interfaceXMLStreamReader
-
getAttributeType
- Specified by:
getAttributeTypein interfaceXMLStreamReader
-
getAttributeValue
- Specified by:
getAttributeValuein interfaceXMLStreamReader
-
getAttributeValue
- Specified by:
getAttributeValuein 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:
getElementTextin 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:
getEventTypein interfaceXMLStreamReader
-
getLocalName
- Specified by:
getLocalNamein interfaceXMLStreamReader
-
getName
- Specified by:
getNamein interfaceXMLStreamReader
-
getNamespaceContext
- Specified by:
getNamespaceContextin interfaceXMLStreamReader
-
getNamespaceCount
public final int getNamespaceCount()- Specified by:
getNamespaceCountin interfaceXMLStreamReader
-
getNamespacePrefix
- Specified by:
getNamespacePrefixin interfaceXMLStreamReader
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceXMLStreamReader
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceXMLStreamReader
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceXMLStreamReader
-
getPIData
- Specified by:
getPIDatain interfaceXMLStreamReader
-
getPITarget
- Specified by:
getPITargetin interfaceXMLStreamReader
-
getPrefix
- Specified by:
getPrefixin interfaceXMLStreamReader
-
getText
- Specified by:
getTextin interfaceXMLStreamReader
-
getTextCharacters
public final char[] getTextCharacters()- Specified by:
getTextCharactersin interfaceXMLStreamReader
-
getTextCharacters
public final int getTextCharacters(int srcStart, char[] target, int targetStart, int len) - Specified by:
getTextCharactersin interfaceXMLStreamReader
-
getTextLength
public final int getTextLength()- Specified by:
getTextLengthin interfaceXMLStreamReader
-
getTextStart
public final int getTextStart()- Specified by:
getTextStartin interfaceXMLStreamReader
-
hasName
public final boolean hasName()- Specified by:
hasNamein interfaceXMLStreamReader
-
hasNext
public final boolean hasNext()- Specified by:
hasNextin interfaceXMLStreamReader
-
hasText
public final boolean hasText()- Specified by:
hasTextin interfaceXMLStreamReader
-
isAttributeSpecified
public final boolean isAttributeSpecified(int index) - Specified by:
isAttributeSpecifiedin interfaceXMLStreamReader
-
isCharacters
public final boolean isCharacters()- Specified by:
isCharactersin interfaceXMLStreamReader
-
isEndElement
public final boolean isEndElement()- Specified by:
isEndElementin interfaceXMLStreamReader
-
isStartElement
public final boolean isStartElement()- Specified by:
isStartElementin interfaceXMLStreamReader
-
isWhiteSpace
public final boolean isWhiteSpace()- Specified by:
isWhiteSpacein interfaceXMLStreamReader
-
require
- Specified by:
requirein interfaceXMLStreamReader- Throws:
XMLStreamException
-
next
- Specified by:
nextin interfaceXMLStreamReader- Throws:
XMLStreamException
-
nextTag
- Specified by:
nextTagin 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_INPUTis set to true).- Specified by:
closein interfaceXMLStreamReader- Throws:
XMLStreamException
-
getLocation
- Specified by:
getLocationin interfaceorg.codehaus.stax2.LocationInfo- Specified by:
getLocationin interfaceXMLStreamReader
-
getElementAsBoolean
- Specified by:
getElementAsBooleanin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getElementAsInt
- Specified by:
getElementAsIntin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getElementAsLong
- Specified by:
getElementAsLongin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getElementAsFloat
- Specified by:
getElementAsFloatin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getElementAsDouble
- Specified by:
getElementAsDoublein interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getElementAsInteger
- Specified by:
getElementAsIntegerin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getElementAsDecimal
- Specified by:
getElementAsDecimalin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getElementAsQName
- Specified by:
getElementAsQNamein interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getElementAsBinary
- Specified by:
getElementAsBinaryin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getElementAs
public final void getElementAs(org.codehaus.stax2.typed.TypedValueDecoder tvd) throws XMLStreamException - Specified by:
getElementAsin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getElementAsBinary
public final byte[] getElementAsBinary(org.codehaus.stax2.typed.Base64Variant v) throws XMLStreamException - Specified by:
getElementAsBinaryin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
readElementAsIntArray
- Specified by:
readElementAsIntArrayin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
readElementAsLongArray
public final int readElementAsLongArray(long[] value, int from, int length) throws XMLStreamException - Specified by:
readElementAsLongArrayin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
readElementAsFloatArray
public final int readElementAsFloatArray(float[] value, int from, int length) throws XMLStreamException - Specified by:
readElementAsFloatArrayin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
readElementAsDoubleArray
public final int readElementAsDoubleArray(double[] value, int from, int length) throws XMLStreamException - Specified by:
readElementAsDoubleArrayin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
readElementAsArray
public final int readElementAsArray(org.codehaus.stax2.typed.TypedArrayDecoder dec) throws XMLStreamException - Specified by:
readElementAsArrayin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
readElementAsBinary
public final int readElementAsBinary(byte[] resultBuffer, int offset, int maxLength) throws XMLStreamException - Specified by:
readElementAsBinaryin 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:
readElementAsBinaryin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getAttributeIndex
-
getAttributeAsBoolean
- Specified by:
getAttributeAsBooleanin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getAttributeAsInt
- Specified by:
getAttributeAsIntin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getAttributeAsLong
- Specified by:
getAttributeAsLongin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getAttributeAsFloat
- Specified by:
getAttributeAsFloatin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getAttributeAsDouble
- Specified by:
getAttributeAsDoublein interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getAttributeAsInteger
- Specified by:
getAttributeAsIntegerin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getAttributeAsDecimal
- Specified by:
getAttributeAsDecimalin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getAttributeAsQName
- Specified by:
getAttributeAsQNamein interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getAttributeAs
public final void getAttributeAs(int index, org.codehaus.stax2.typed.TypedValueDecoder tvd) throws XMLStreamException - Specified by:
getAttributeAsin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getAttributeAsIntArray
- Specified by:
getAttributeAsIntArrayin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getAttributeAsLongArray
- Specified by:
getAttributeAsLongArrayin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getAttributeAsFloatArray
- Specified by:
getAttributeAsFloatArrayin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getAttributeAsDoubleArray
- Specified by:
getAttributeAsDoubleArrayin 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:
getAttributeAsArrayin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Returns:
- Number of tokens decoded, 0 if none found
- Throws:
XMLStreamException
-
getAttributeAsBinary
- Specified by:
getAttributeAsBinaryin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
getAttributeAsBinary
public final byte[] getAttributeAsBinary(int index, org.codehaus.stax2.typed.Base64Variant v) throws XMLStreamException - Specified by:
getAttributeAsBinaryin interfaceorg.codehaus.stax2.typed.TypedXMLStreamReader- Throws:
XMLStreamException
-
verifyQName
-
getFeature
Deprecated.- Specified by:
getFeaturein interfaceorg.codehaus.stax2.XMLStreamReader2
-
setFeature
Deprecated.- Specified by:
setFeaturein interfaceorg.codehaus.stax2.XMLStreamReader2
-
isPropertySupported
- Specified by:
isPropertySupportedin interfaceorg.codehaus.stax2.XMLStreamReader2
-
setProperty
- Specified by:
setPropertyin 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:
skipElementin interfaceorg.codehaus.stax2.XMLStreamReader2- Throws:
XMLStreamException
-
getAttributeInfo
- Specified by:
getAttributeInfoin interfaceorg.codehaus.stax2.XMLStreamReader2- Throws:
XMLStreamException
-
getDTDInfo
Since this class implementsDTDInfo, method can just returnthis.- Specified by:
getDTDInfoin interfaceorg.codehaus.stax2.XMLStreamReader2- Throws:
XMLStreamException
-
getLocationInfo
public final org.codehaus.stax2.LocationInfo getLocationInfo()Location information is always accessible, for this reader.- Specified by:
getLocationInfoin 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:
getTextin interfaceorg.codehaus.stax2.XMLStreamReader2- Parameters:
w- Writer to use for writing textual contentspreserveContents- If true, reader has to preserve contents so that further calls togetTextwill 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 togetTextis not guaranteed to return meaningful data.- Returns:
- Number of characters written to the reader
- Throws:
XMLStreamException
-
getDepth
public final int getDepth()- Specified by:
getDepthin 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:
isEmptyElementin 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:
getNonTransientNamespaceContextin interfaceorg.codehaus.stax2.XMLStreamReader2
-
getPrefixedName
- Specified by:
getPrefixedNamein interfaceorg.codehaus.stax2.XMLStreamReader2
-
closeCompletely
- Specified by:
closeCompletelyin interfaceorg.codehaus.stax2.XMLStreamReader2- Throws:
XMLStreamException
-
getProcessedDTD
Note: DTD-handling sub-classes need to override this method.
- Specified by:
getProcessedDTDin interfaceorg.codehaus.stax2.DTDInfo
-
getDTDRootName
- Specified by:
getDTDRootNamein interfaceorg.codehaus.stax2.DTDInfo
-
getDTDPublicId
- Specified by:
getDTDPublicIdin interfaceorg.codehaus.stax2.DTDInfo
-
getDTDSystemId
- Specified by:
getDTDSystemIdin interfaceorg.codehaus.stax2.DTDInfo
-
getDTDInternalSubset
- Specified by:
getDTDInternalSubsetin 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:
getProcessedDTDSchemain interfaceorg.codehaus.stax2.DTDInfo
-
getStartingByteOffset
public final long getStartingByteOffset()- Specified by:
getStartingByteOffsetin interfaceorg.codehaus.stax2.LocationInfo
-
getStartingCharOffset
public final long getStartingCharOffset()- Specified by:
getStartingCharOffsetin interfaceorg.codehaus.stax2.LocationInfo
-
getEndingByteOffset
- Specified by:
getEndingByteOffsetin interfaceorg.codehaus.stax2.LocationInfo- Throws:
XMLStreamException
-
getEndingCharOffset
- Specified by:
getEndingCharOffsetin interfaceorg.codehaus.stax2.LocationInfo- Throws:
XMLStreamException
-
getStartLocation
public final org.codehaus.stax2.XMLStreamLocation2 getStartLocation()- Specified by:
getStartLocationin interfaceorg.codehaus.stax2.LocationInfo
-
getEndLocation
- Specified by:
getEndLocationin interfaceorg.codehaus.stax2.LocationInfo- Throws:
XMLStreamException
-
getCurrentLocation
public final org.codehaus.stax2.XMLStreamLocation2 getCurrentLocation()- Specified by:
getCurrentLocationin interfaceorg.codehaus.stax2.LocationInfo
-
findAttributeIndex
-
getIdAttributeIndex
public final int getIdAttributeIndex()- Specified by:
getIdAttributeIndexin interfaceorg.codehaus.stax2.AttributeInfo
-
getNotationAttributeIndex
public final int getNotationAttributeIndex()- Specified by:
getNotationAttributeIndexin interfaceorg.codehaus.stax2.AttributeInfo
-
validateAgainst
public final org.codehaus.stax2.validation.XMLValidator validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema) throws XMLStreamException - Specified by:
validateAgainstin 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:
stopValidatingAgainstin 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:
stopValidatingAgainstin interfaceorg.codehaus.stax2.validation.Validatable- Throws:
XMLStreamException
-
setValidationProblemHandler
public final org.codehaus.stax2.validation.ValidationProblemHandler setValidationProblemHandler(org.codehaus.stax2.validation.ValidationProblemHandler h) - Specified by:
setValidationProblemHandlerin 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
-