Top Description Fields Constructors Methods
org.codehaus.stax2.ri

public abstract Class Stax2ReaderImpl

extends Object
implements XMLStreamReader2, AttributeInfo, DTDInfo, LocationInfo
Class Inheritance
All Implemented Interfaces
org.codehaus.stax2.LocationInfo, org.codehaus.stax2.DTDInfo, org.codehaus.stax2.AttributeInfo, org.codehaus.stax2.XMLStreamReader2, org.codehaus.stax2.validation.Validatable, org.codehaus.stax2.typed.TypedXMLStreamReader, javax.xml.stream.XMLStreamReader, javax.xml.stream.XMLStreamConstants
Imports
java.io.IOException, .Writer, java.math.BigDecimal, .BigInteger, javax.xml.namespace.NamespaceContext, .QName, javax.xml.stream.*, org.codehaus.stax2.*, org.codehaus.stax2.typed.Base64Variant, .Base64Variants, .TypedArrayDecoder, .TypedValueDecoder, .TypedXMLStreamException, org.codehaus.stax2.validation.*, org.codehaus.stax2.ri.typed.ValueDecoderFactory

This is a partial base implementation of XMLStreamReader2, the extended stream reader that is part of Stax2.

Field Summary

Modifier and TypeField and Description
protected ValueDecoderFactory
_decoderFactory

Factory used for constructing decoders we need for typed access

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected TypedXMLStreamException
protected ValueDecoderFactory
public void
closeCompletely()

Implements org.codehaus.stax2.XMLStreamReader2.closeCompletely.

Method similar to javax.xml.stream.XMLStreamReader#close, except that this method also does close the underlying input source if it has not yet been closed.
public int
public void
getAttributeAs(int index, TypedValueDecoder tvd)

Implements org.codehaus.stax2.typed.TypedXMLStreamReader.getAttributeAs.

Generic access method that can be used for efficient decoding of additional types not support natively by the typed stream reader.
public abstract int
getAttributeAsArray(int index, TypedArrayDecoder tad)

Redeclares org.codehaus.stax2.typed.TypedXMLStreamReader.getAttributeAsArray.

Actual implementation needs to implement tokenization.
public byte[]
getAttributeAsBinary(int
The attribute's index as returned by getAttributeIndex(String, String).
index
)

Implements org.codehaus.stax2.typed.TypedXMLStreamReader.getAttributeAsBinary.

Read an attribute value as a byte array.
public abstract byte[]
public boolean
getAttributeAsBoolean(int
The attribute's index as returned by getAttributeIndex(String, String)
index
)

Implements org.codehaus.stax2.typed.TypedXMLStreamReader.getAttributeAsBoolean.

Read an attribute value as a boolean.

public BigDecimal
public double
public double[]
public float
public float[]
public int
getAttributeAsInt(int
The attribute's index as returned by getAttributeIndex(String, String)
index
)

Implements org.codehaus.stax2.typed.TypedXMLStreamReader.getAttributeAsInt.

Read an attribute value as a boolean.

public int[]
getAttributeAsIntArray(int
The attribute's index as returned by getAttributeIndex(String, String).
index
)

Implements org.codehaus.stax2.typed.TypedXMLStreamReader.getAttributeAsIntArray.

Read an attribute content as an int array.

public BigInteger
public long
getAttributeAsLong(int
The attribute's index as returned by getAttributeIndex(String, String)
index
)

Implements org.codehaus.stax2.typed.TypedXMLStreamReader.getAttributeAsLong.

Read an attribute value as a boolean.

public long[]
public QName
public abstract int
getAttributeIndex(String
The attribute's namespace URI. Values of null and "" are considered the same, i.e. "no namespace" (or "empty" namespace)
namespaceURI
,
String
The attribute's local name.
localName
)

Redeclares org.codehaus.stax2.typed.TypedXMLStreamReader.getAttributeIndex.

Returns the index of the attribute whose local name is localName and URI is namespaceURI or -1 if no such attribute exists.
public AttributeInfo
getAttributeInfo()

Implements org.codehaus.stax2.XMLStreamReader2.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.
public abstract XMLStreamLocation2
getCurrentLocation()

Redeclares org.codehaus.stax2.LocationInfo.getCurrentLocation.

A method that returns the current location of the stream reader at the input source.
public abstract int

Returns:

Number of open elements in the stack; 0 when parser is in prolog/epilog, 1 inside root element and so on.
getDepth
()

Redeclares org.codehaus.stax2.XMLStreamReader2.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.
public DTDInfo
getDTDInfo()

Implements org.codehaus.stax2.XMLStreamReader2.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.
public String

Returns:

Internal subset portion of the DOCTYPE declaration, if any; empty String if none
getDTDInternalSubset
()

Implements org.codehaus.stax2.DTDInfo.getDTDInternalSubset.

public String
public String
public String
public void
getElementAs(TypedValueDecoder tvd)

Implements org.codehaus.stax2.typed.TypedXMLStreamReader.getElementAs.

Generic decoding method that can be used for efficient decoding of additional types not support natively by the typed stream reader.
public byte[]
getElementAsBinary()

Implements org.codehaus.stax2.typed.TypedXMLStreamReader.getElementAsBinary.

Convenience method that can be used similar to read binary content instead of readElementAsBinary, in cases where neither performance nor memory usage is a big concern.
public abstract byte[]
getElementAsBinary(Base64Variant
Base64 variant content is in; needed to decode alternative variants ("modified base64")
v
)

Redeclares org.codehaus.stax2.typed.TypedXMLStreamReader.getElementAsBinary.

Convenience method that can be used similar to read binary content instead of readElementAsBinary, in cases where neither performance nor memory usage is a big concern.
public boolean
public BigDecimal
public double
getElementAsDouble()

Implements org.codehaus.stax2.typed.TypedXMLStreamReader.getElementAsDouble.

Read an element content as a 64-bit floating point value.

public float
getElementAsFloat()

Implements org.codehaus.stax2.typed.TypedXMLStreamReader.getElementAsFloat.

Read an element content as a 32-bit floating point value.

public int
getElementAsInt()

Implements org.codehaus.stax2.typed.TypedXMLStreamReader.getElementAsInt.

Read an element content as a 32-bit integer.

public BigInteger
public long
getElementAsLong()

Implements org.codehaus.stax2.typed.TypedXMLStreamReader.getElementAsLong.

Read an element content as a 64-bit integer.

public QName
public long
getEndingByteOffset()

Implements org.codehaus.stax2.LocationInfo.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.
public long
getEndingCharOffset()

Implements org.codehaus.stax2.LocationInfo.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.
public abstract XMLStreamLocation2
getEndLocation()

Redeclares org.codehaus.stax2.LocationInfo.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).
public Object
getFeature(String
Name of the feature of which value to get
name
)

Implements org.codehaus.stax2.XMLStreamReader2.getFeature.

Deprecated
Method that can be used to get per-reader values; both generic ones (names for which are defined as constants in this class), and implementation dependant ones.
public int
getIdAttributeIndex()

Implements org.codehaus.stax2.AttributeInfo.getIdAttributeIndex.

Returns the index of the id attribute (attribute with any name, type ID from DTD) of current (start) element, if any.
public final LocationInfo
getLocationInfo()

Implements org.codehaus.stax2.XMLStreamReader2.getLocationInfo.

Location information is always accessible, for this reader.
public abstract NamespaceContext
getNonTransientNamespaceContext()

Redeclares org.codehaus.stax2.XMLStreamReader2.getNonTransientNamespaceContext.

This method returns a namespace context object that contains information identical to that returned by javax.xml.stream.XMLStreamReader#getNamespaceContext(), but one that is not transient.
public int
getNotationAttributeIndex()

Implements org.codehaus.stax2.AttributeInfo.getNotationAttributeIndex.

Returns the index of the notation attribute (attribute with any name, type NOTATION from DTD) of current (start) element, if any.
public String
getPrefixedName()

Implements org.codehaus.stax2.XMLStreamReader2.getPrefixedName.

This method returns "prefix-qualified" name of the current element.
public Object
public DTDValidationSchema
public long
getStartingByteOffset()

Implements org.codehaus.stax2.LocationInfo.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.
public long
getStartingCharOffset()

Implements org.codehaus.stax2.LocationInfo.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.
public abstract XMLStreamLocation2
getStartLocation()

Redeclares org.codehaus.stax2.LocationInfo.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).
public int
getText(Writer
Writer to use for writing textual contents
w
,
boolean
If true, reader has to preserve contents so that further calls to 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.
preserveContents
)

Implements org.codehaus.stax2.XMLStreamReader2.getText.

Method similar to getText(), except that it just uses provided Writer to write all textual content, and that it works for wider range of event types.
public abstract boolean
isEmptyElement()

Redeclares org.codehaus.stax2.XMLStreamReader2.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.
public boolean
isPropertySupported(String name)

Implements org.codehaus.stax2.XMLStreamReader2.isPropertySupported.

Method similar to javax.xml.stream.XMLInputFactory#isPropertySupported, used to determine whether a property is supported by the Reader instance.
public abstract int
readElementAsArray(TypedArrayDecoder dec)

Redeclares org.codehaus.stax2.typed.TypedXMLStreamReader.readElementAsArray.

Actual implementation needs to implement tokenization and state keeping.
public int
readElementAsBinary(byte[] resultBuffer, int offset, int maxLength)

Implements org.codehaus.stax2.typed.TypedXMLStreamReader.readElementAsBinary.

public abstract int
readElementAsBinary(Base64Variant b64variant, byte[] resultBuffer, int offset, int maxLength)

public int
public int
public int
readElementAsIntArray(int[]
The array in which to copy the ints.
value
,
int
The index in the array from which copying starts.
from
,
int
The maximun number of ints to copy. Minimum value is 1; others an IllegalArgumentException is thrown
length
)

Implements org.codehaus.stax2.typed.TypedXMLStreamReader.readElementAsIntArray.

Read an element content as an int array.
public int
public void
setFeature(String
Name of the feature to set
name
,
Object
Value to set feature to.
value
)

Implements org.codehaus.stax2.XMLStreamReader2.setFeature.

Deprecated
Method that can be used to set per-reader features such as configuration settings; both generic ones (names for which are defined as constants in this class), and implementation dependant ones.
public boolean
setProperty(String
Name of the property to set
name
,
Object
Value to set property to.
value
)

Implements org.codehaus.stax2.XMLStreamReader2.setProperty.

Method that can be used to set per-reader properties; a subset of properties one can set via matching org.codehaus.stax2.XMLInputFactory2 instance.
public abstract ValidationProblemHandler
setValidationProblemHandler(ValidationProblemHandler
Handler to install, if non null; if null, indicates that the default (implementation-specific) handling should be used
h
)

Redeclares org.codehaus.stax2.validation.Validatable.setValidationProblemHandler.

Method that application can call to define a custom handler for validation problems encountered during validation process.
public void
skipElement()

Implements org.codehaus.stax2.XMLStreamReader2.skipElement.

Method that will skip all the contents of the element that the stream currently points to.
public XMLValidator
stopValidatingAgainst(XMLValidationSchema schema)

Implements org.codehaus.stax2.validation.Validatable.stopValidatingAgainst.

Method that can be called by application to stop validating output against a schema, for which validateAgainst was called earlier.
public XMLValidator
stopValidatingAgainst(XMLValidator validator)

Implements org.codehaus.stax2.validation.Validatable.stopValidatingAgainst.

Method that can be called by application to stop validating output using specified validator.
protected void
protected void
public XMLValidator
validateAgainst(XMLValidationSchema schema)

Implements org.codehaus.stax2.validation.Validatable.validateAgainst.

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 stopValidatingAgainst.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait