java.lang.Object | |
↳ | javax.xml.stream.XMLInputFactory |
Defines an abstract implementation of a factory for getting streams. The following table defines the standard properties of this specification. Each property varies in the level of support required by each implementation. The level of support required is described in the 'Required' column.
Configuration parameters | ||||
---|---|---|---|---|
Property Name | Behavior | Return type | Default Value | Required |
javax.xml.stream.isValidating | Turns on/off implementation specific DTD validation | Boolean | False | No |
javax.xml.stream.isNamespaceAware | Turns on/off namespace processing for XML 1.0 support | Boolean | True | True (required) / False (optional) |
javax.xml.stream.isCoalescing | Requires the processor to coalesce adjacent character data | Boolean | False | Yes |
javax.xml.stream.isReplacingEntityReferences | replace internal entity references with their replacement text and report them as characters | Boolean | True | Yes |
javax.xml.stream.isSupportingExternalEntities | Resolve external parsed entities | Boolean | Unspecified | Yes |
javax.xml.stream.supportDTD | Use this property to request processors that do not support DTDs | Boolean | True | Yes |
javax.xml.stream.reporter | sets/gets the impl of the XMLReporter | javax.xml.stream.XMLReporter | Null | Yes |
javax.xml.stream.resolver | sets/gets the impl of the XMLResolver interface | javax.xml.stream.XMLResolver | Null | Yes |
javax.xml.stream.allocator | sets/gets the impl of the XMLEventAllocator interface | javax.xml.stream.util.XMLEventAllocator | Null | Yes |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ALLOCATOR | The property used to set/get the implementation of the allocator | |||||||||
String | IS_COALESCING | The property that requires the parser to coalesce adjacent character data sections | |||||||||
String | IS_NAMESPACE_AWARE | The property used to turn on/off namespace support, this is to support XML 1.0 documents, only the true setting must be supported | |||||||||
String | IS_REPLACING_ENTITY_REFERENCES | Requires the parser to replace internal entity references with their replacement text and report them as characters | |||||||||
String | IS_SUPPORTING_EXTERNAL_ENTITIES | The property that requires the parser to resolve external parsed entities | |||||||||
String | IS_VALIDATING | The property used to turn on/off implementation specific validation | |||||||||
String | REPORTER | The property used to set/get the implementation of the XMLReporter interface | |||||||||
String | RESOLVER | The property used to set/get the implementation of the XMLResolver | |||||||||
String | SUPPORT_DTD | The property that requires the parser to support DTDs |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a filtered event reader that wraps the filter around the event reader
| |||||||||||
Create a filtered reader that wraps the filter around the reader
| |||||||||||
Create a new XMLEventReader from a java.io.InputStream
| |||||||||||
Create a new XMLEventReader from an XMLStreamReader.
| |||||||||||
Create a new XMLEventReader from a java.io.InputStream
| |||||||||||
Create a new XMLEventReader from a reader
| |||||||||||
Create a new XMLEventReader from a java.io.InputStream
| |||||||||||
Create a new XMLEventReader from a reader
| |||||||||||
Create a new XMLEventReader from a JAXP source.
| |||||||||||
Create a new XMLStreamReader from a java.io.InputStream
| |||||||||||
Create a new XMLStreamReader from a reader
| |||||||||||
Create a new XMLStreamReader from a java.io.InputStream
| |||||||||||
Create a new XMLStreamReader from a java.io.InputStream
| |||||||||||
Create a new XMLStreamReader from a JAXP source.
| |||||||||||
Create a new XMLStreamReader from a java.io.InputStream
| |||||||||||
Gets the allocator used by streams created with this factory
| |||||||||||
Get the value of a feature/property from the underlying implementation
| |||||||||||
The reporter that will be set on any XMLStreamReader or XMLEventReader created
by this factory instance.
| |||||||||||
The resolver that will be set on any XMLStreamReader or XMLEventReader created
by this factory instance.
| |||||||||||
Query the set of properties that this factory supports.
| |||||||||||
Create a new instance of the factory.
| |||||||||||
Create a new instance of the factory.
| |||||||||||
This method is deprecated.
This method has been deprecated to maintain API consistency.
All newInstance methods have been replaced with corresponding
newFactory methods. The replacement
newFactory(java.lang.String, java.lang.ClassLoader) method
defines no changes in behavior.
| |||||||||||
Create a new instance of the factory.
| |||||||||||
Set a user defined event allocator for events
| |||||||||||
Allows the user to set specific feature/property on the underlying implementation.
| |||||||||||
The reporter that will be set on any XMLStreamReader or XMLEventReader created
by this factory instance.
| |||||||||||
The resolver that will be set on any XMLStreamReader or XMLEventReader created
by this factory instance.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
The property used to set/get the implementation of the allocator
The property that requires the parser to coalesce adjacent character data sections
The property used to turn on/off namespace support, this is to support XML 1.0 documents, only the true setting must be supported
Requires the parser to replace internal entity references with their replacement text and report them as characters
The property that requires the parser to resolve external parsed entities
The property used to turn on/off implementation specific validation
The property used to set/get the implementation of the XMLReporter interface
The property used to set/get the implementation of the XMLResolver
The property that requires the parser to support DTDs
Create a filtered event reader that wraps the filter around the event reader
reader | the event reader to wrap |
---|---|
filter | the filter to apply to the event reader |
XMLStreamException |
---|
Create a filtered reader that wraps the filter around the reader
reader | the reader to filter |
---|---|
filter | the filter to apply to the reader |
XMLStreamException |
---|
Create a new XMLEventReader from a java.io.InputStream
systemId | the system ID of the stream |
---|---|
stream | the InputStream to read from |
XMLStreamException |
---|
Create a new XMLEventReader from an XMLStreamReader. After being used to construct the XMLEventReader instance returned from this method the XMLStreamReader must not be used.
reader | the XMLStreamReader to read from (may not be modified) |
---|
XMLStreamException |
---|
Create a new XMLEventReader from a java.io.InputStream
stream | the InputStream to read from |
---|---|
encoding | the character encoding of the stream |
XMLStreamException |
---|
Create a new XMLEventReader from a reader
reader | the XML data to read from |
---|
XMLStreamException |
---|
Create a new XMLEventReader from a java.io.InputStream
stream | the InputStream to read from |
---|
XMLStreamException |
---|
Create a new XMLEventReader from a reader
systemId | the system ID of the input |
---|---|
reader | the XML data to read from |
XMLStreamException |
---|
Create a new XMLEventReader from a JAXP source. Support of this method is optional.
source | the source to read from |
---|
UnsupportedOperationException | if this method is not supported by this XMLInputFactory |
---|---|
XMLStreamException |
Create a new XMLStreamReader from a java.io.InputStream
stream | the InputStream to read from |
---|
XMLStreamException |
---|
Create a new XMLStreamReader from a reader
reader | the XML data to read from |
---|
XMLStreamException |
---|
Create a new XMLStreamReader from a java.io.InputStream
systemId | the system ID of the stream |
---|---|
reader | the InputStream to read from |
XMLStreamException |
---|
Create a new XMLStreamReader from a java.io.InputStream
systemId | the system ID of the stream |
---|---|
stream | the InputStream to read from |
XMLStreamException |
---|
Create a new XMLStreamReader from a JAXP source. This method is optional.
source | the source to read from |
---|
UnsupportedOperationException | if this method is not supported by this XMLInputFactory |
---|---|
XMLStreamException |
Create a new XMLStreamReader from a java.io.InputStream
stream | the InputStream to read from |
---|---|
encoding | the character encoding of the stream |
XMLStreamException |
---|
Gets the allocator used by streams created with this factory
Get the value of a feature/property from the underlying implementation
name | The name of the property (may not be null) |
---|
IllegalArgumentException | if the property is not supported |
---|
The reporter that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.
The resolver that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.
Query the set of properties that this factory supports.
name | The name of the property (may not be null) |
---|
Create a new instance of the factory. This static method creates a new factory instance. This method uses the following ordered lookup procedure to determine the XMLInputFactory implementation class to load: Use the javax.xml.stream.XMLInputFactory system property. Use the properties file "lib/stax.properties" in the JRE directory. This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above. Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a classname in the file META-INF/services/javax.xml.stream.XMLInputFactory in jars available to the runtime. Platform default XMLInputFactory instance. Once an application has obtained a reference to a XMLInputFactory it can use the factory to configure and obtain stream instances. Note that this is a new method that replaces the deprecated newInstance() method. No changes in behavior are defined by this replacement method relative to the deprecated method.
FactoryConfigurationError | if an instance of this factory cannot be loaded |
---|
Create a new instance of the factory. If the classLoader argument is null, then the ContextClassLoader is used. Note that this is a new method that replaces the deprecated newInstance(String factoryId, ClassLoader classLoader) method. No changes in behavior are defined by this replacement method relative to the deprecated method.
factoryId | Name of the factory to find, same as a property name |
---|---|
classLoader | classLoader to use |
FactoryConfigurationError | if an instance of this factory cannot be loaded |
---|
This method is deprecated.
This method has been deprecated to maintain API consistency.
All newInstance methods have been replaced with corresponding
newFactory methods. The replacement newFactory(java.lang.String, java.lang.ClassLoader)
method
defines no changes in behavior.
Create a new instance of the factory
factoryId | Name of the factory to find, same as a property name |
---|---|
classLoader | classLoader to use |
FactoryConfigurationError | if an instance of this factory cannot be loaded |
---|
Create a new instance of the factory.
FactoryConfigurationError | if an instance of this factory cannot be loaded |
---|
Set a user defined event allocator for events
allocator | the user defined allocator |
---|
Allows the user to set specific feature/property on the underlying implementation. The underlying implementation is not required to support every setting of every property in the specification and may use IllegalArgumentException to signal that an unsupported property may not be set with the specified value.
name | The name of the property (may not be null) |
---|---|
value | The value of the property |
IllegalArgumentException | if the property is not supported |
---|
The reporter that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.
reporter | the resolver to use to report non fatal errors |
---|
The resolver that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.
resolver | the resolver to use to resolve references |
---|