Enum InputType
- All Implemented Interfaces:
Serializable
,Comparable<InputType>
,java.lang.constant.Constable
Creates
XMLStreamReader
from a given input. This enumeration allows to analyze the input type
only once before to create as many instances of XMLStreamReader
as needed for that input.
The enumeration order is the preference order (i.e. we will test if the object already implements the
XMLStreamReader
interface before to test for InputStream
, Reader
, etc.).
Some kinds of inputs can be used many time (for example Node
).
Other inputs can be used only once (for example XMLEventReader
).
For some inputs, it depends on whether the stream support marks.
- Since:
- 0.8
- Version:
- 0.8
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe input is an instance of Java I/OReader
.The input is an instance of STAXXMLEventReader
.The input is an instance of DOMNode
.The input is an instance of SAXInputSource
.The input is an instance of XMLSource
, which is itself a wrapper around another kind of source.The input is already an instance ofXMLStreamReader
.The input is an instance of Java I/OInputStream
. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) abstract XMLStreamReader
create
(StaxDataStore ds, Object s) Creates a XML reader for the given input.(package private) static InputType
Returns aReaderFactory
for the given input type.static InputType
Returns the enum constant of this type with the specified name.static InputType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
STAX
The input is already an instance ofXMLStreamReader
. That input is returned directly and can be used only once. -
STREAM
The input is an instance of Java I/OInputStream
. Decoding may depend on the data store character encoding. -
CHARACTERS
The input is an instance of Java I/OReader
. -
SOURCE
The input is an instance of XMLSource
, which is itself a wrapper around another kind of source. -
NODE
The input is an instance of DOMNode
. -
SAX
The input is an instance of SAXInputSource
. -
EVENT
The input is an instance of STAXXMLEventReader
.
-
-
Field Details
-
inputType
The kind of input that this enumeration can handle.
-
-
Constructor Details
-
InputType
Creates a new enumeration for the given type of input.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
create
Creates a XML reader for the given input.- Parameters:
ds
- the data store for which to create reader instances.s
- the input stream or the storage object (URL, etc).- Returns:
- the XML reader.
- Throws:
XMLStreamException
- if the XML reader creation failed.
-
forType
Returns aReaderFactory
for the given input type. Thetype
argument given to this method shall be the class of thes
argument to be given increate(StaxDataStore, Object)
calls.- Parameters:
type
- the type of the input stream or storage object (URL, etc).- Returns:
- a factory for the given stream or storage type, or
null
if the given type is not recognized.
-