Top Description Methods
org.codehaus.stax2

public Interface XMLEventReader2

extends XMLEventReader
Known Direct Implementers
org.codehaus.stax2.ri.Stax2EventReaderImpl, org.codehaus.stax2.ri.evt.Stax2EventReaderAdapter, org.codehaus.stax2.ri.evt.Stax2FilteredEventReader
Imports
javax.xml.stream.XMLEventReader, .XMLStreamException

Extended interface that implements functionality that is missing from XMLEventReader, based on findings on trying to implement Stax API v1.0.

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNextEvent()

Method that is similar to hasNext, except that it can throw a XMLStreamException.

public boolean
isPropertySupported(String name)

Method similar to javax.xml.stream.XMLInputFactory#isPropertySupported, used to determine whether a property is supported by the Reader instance.

public boolean

Returns:

True, if the specified property was succesfully set to specified value; false if its value was not changed
setProperty
(String
Name of the property to set
name
,
Object
Value to set property to.
value
)

Method that can be used to set per-reader properties; a subset of properties one can set via matching org.codehaus.stax2.XMLInputFactory2 instance.

Inherited from javax.xml.stream.XMLEventReader:
closegetElementTextgetPropertyhasNextnextEventnextTagpeek

Method Detail

hasNextEventback to summary
public boolean hasNextEvent() throws XMLStreamException

Method that is similar to hasNext, except that it can throw a XMLStreamException. This is important distinction, since the underlying stream reader is NOT allowed to throw such an exception when its hasNext() gets called; but the underlying parser may well need to advance the input stream and in doing so may encounter an exception. This exception should be propagated to the caller, as it may signal a problem with the input stream or xml content.

isPropertySupportedback to summary
public boolean isPropertySupported(String name)

Method similar to javax.xml.stream.XMLInputFactory#isPropertySupported, 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.

Since
3.0
setPropertyback to summary
public 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 org.codehaus.stax2.XMLInputFactory2 instance. Exactly which methods are mutable is implementation specific.

Parameters
name:String

Name of the property to set

value:Object

Value to set property to.

Returns:boolean

True, if the specified property was succesfully set to specified value; false if its value was not changed

Exceptions
IllegalArgumentException:
if the property is not supported (or recognized) by the stream reader implementation
Since
3.0