Top Fields Constructors Methods
org.codehaus.stax2.util

public Class StreamReader2Delegate

extends StreamReaderDelegate
implements XMLStreamReader2
Class Inheritance
All Implemented Interfaces
org.codehaus.stax2.XMLStreamReader2, org.codehaus.stax2.validation.Validatable, org.codehaus.stax2.typed.TypedXMLStreamReader, javax.xml.stream.XMLStreamReader, javax.xml.stream.XMLStreamConstants
Known Direct Subclasses
org.codehaus.stax2.ri.Stax2FilteredStreamReader
Imports
java.io.IOException, .Writer, java.math.BigDecimal, .BigInteger, javax.xml.namespace.NamespaceContext, .QName, javax.xml.stream.XMLStreamException, .XMLStreamReader, javax.xml.stream.util.StreamReaderDelegate, org.codehaus.stax2.AttributeInfo, .DTDInfo, .LocationInfo, .XMLStreamReader2, org.codehaus.stax2.typed.Base64Variant, .TypedArrayDecoder, .TypedValueDecoder, org.codehaus.stax2.validation.ValidationProblemHandler, .XMLValidationSchema, .XMLValidator

Field Summary

Modifier and TypeField and Description
protected XMLStreamReader2

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
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 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 int
getAttributeAsArray(int index, TypedArrayDecoder tad)

Implements org.codehaus.stax2.typed.TypedXMLStreamReader.getAttributeAsArray.

Method that allows reading contents of an attribute as an array of whitespace-separate tokens, decoded using specified decoder.
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 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 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
)

Implements 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 int
getDepth()

Implements 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 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 byte[]
getElementAsBinary(Base64Variant
Base64 variant content is in; needed to decode alternative variants ("modified base64")
v
)

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 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 Object
getFeature(String
Name of the feature of which value to get
name
)

Implements org.codehaus.stax2.XMLStreamReader2.getFeature.

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 LocationInfo
public NamespaceContext
getNonTransientNamespaceContext()

Implements 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 String
getPrefixedName()

Implements org.codehaus.stax2.XMLStreamReader2.getPrefixedName.

This method returns "prefix-qualified" name of the current element.
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 boolean
isEmptyElement()

Implements 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 int
readElementAsArray(TypedArrayDecoder tad)

Implements org.codehaus.stax2.typed.TypedXMLStreamReader.readElementAsArray.

Read an element content as an array of tokens.
public int
readElementAsBinary(byte[] resultBuffer, int offset, int maxLength)

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

public int
readElementAsBinary(byte[]
Array in which to copy decoded bytes.
resultBuffer
,
int
Starting offset of the first decoded byte within result buffer
offset
,
int
Maximum number of bytes to decode with this call
maxLength
,
Base64Variant v)

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

Read element content as decoded byte sequence; possibly only reading a fragment of all element content.
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.

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 void
setParent(XMLStreamReader
the new parent
pr
)

Overrides javax.xml.stream.util.StreamReaderDelegate.setParent.

Set the parent of this instance.
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 ValidationProblemHandler
setValidationProblemHandler(ValidationProblemHandler
Handler to install, if non null; if null, indicates that the default (implementation-specific) handling should be used
h
)

Implements 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.
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 javax.xml.stream.util.StreamReaderDelegate:
closegetAttributeCountgetAttributeLocalNamegetAttributeNamegetAttributeNamespacegetAttributePrefixgetAttributeTypegetAttributeValuegetAttributeValuegetCharacterEncodingSchemegetElementTextgetEncodinggetEventTypegetLocalNamegetLocationgetNamegetNamespaceContextgetNamespaceCountgetNamespacePrefixgetNamespaceURIgetNamespaceURIgetNamespaceURIgetParentgetPIDatagetPITargetgetPrefixgetPropertygetTextgetTextCharactersgetTextCharactersgetTextLengthgetTextStartgetVersionhasNamehasNexthasTextisAttributeSpecifiedisCharactersisEndElementisStandaloneisStartElementisWhiteSpacenextnextTagrequirestandaloneSet