javax.xml.stream

Class XMLInputFactory

public abstract class XMLInputFactory extends Object

Factory for creating stream and event readers from various kinds of input source.

Parameters

Name Description Type Default Required
javax.xml.stream.isValidating Controls DTD validation Boolean Boolean.FALSE no
javax.xml.stream.isNamespaceAware Controls namespace processing for XML 1.0 Boolean Boolean.TRUE true is required, false is optional
javax.xml.stream.isCoalescing Controls coalescing (normalization of adjacent character data) Boolean Boolean.FALSE yes
javax.xml.stream.isReplacingEntityReferences Controls replacement of entity references with their replacement text Boolean Boolean.TRUE yes
javax.xml.stream.isSupportingExternalEntities Controls whether to resolve external entities Boolean not specified yes
javax.xml.stream.supportDTD Controls whether to support DTDs Boolean Boolean.TRUE yes
javax.xml.stream.reporter javax.xml.stream.XMLReporter yes
javax.xml.stream.resolver javax.xml.stream.XMLResolver yes
javax.xml.stream.allocator javax.xml.stream.util.XMLEventAllocator yes
Field Summary
static StringALLOCATOR
Property used to control the event allocator implementation.
static StringIS_COALESCING
Property used to control whether to coalesce adjacent text events.
static StringIS_NAMESPACE_AWARE
Property used to control namespace support.
static StringIS_REPLACING_ENTITY_REFERENCES
Property used to control whether to replace entity references with their replacement text.
static StringIS_SUPPORTING_EXTERNAL_ENTITIES
Property used to control whether to resolve external entities.
static StringIS_VALIDATING
Property used to control DTD validation.
static StringREPORTER
Property used to control the error reporter implementation.
static StringRESOLVER
Property used to control the entity resolver implementation.
static StringSUPPORT_DTD
Property used to indicate whether to support DTDs.
Constructor Summary
protected XMLInputFactory()
Method Summary
abstract XMLStreamReadercreateFilteredReader(XMLStreamReader reader, StreamFilter filter)
Create a new filtered reader.
abstract XMLEventReadercreateFilteredReader(XMLEventReader reader, EventFilter filter)
Create a new filtered reader.
abstract XMLEventReadercreateXMLEventReader(Reader reader)
Creates a new event reader.
abstract XMLEventReadercreateXMLEventReader(String systemId, Reader reader)
Creates a new event reader.
abstract XMLEventReadercreateXMLEventReader(XMLStreamReader reader)
Creates a new event reader.
abstract XMLEventReadercreateXMLEventReader(Source source)
Creates a new event reader.
abstract XMLEventReadercreateXMLEventReader(InputStream stream)
Creates a new event reader.
abstract XMLEventReadercreateXMLEventReader(InputStream stream, String encoding)
Creates a new event reader.
abstract XMLEventReadercreateXMLEventReader(String systemId, InputStream stream)
Creates a new event reader.
abstract XMLStreamReadercreateXMLStreamReader(Reader reader)
Creates a new stream reader.
abstract XMLStreamReadercreateXMLStreamReader(Source source)
Creates a new stream reader.
abstract XMLStreamReadercreateXMLStreamReader(InputStream stream)
Creates a new stream reader.
abstract XMLStreamReadercreateXMLStreamReader(InputStream stream, String encoding)
Creates a new stream reader.
abstract XMLStreamReadercreateXMLStreamReader(String systemId, InputStream stream)
Creates a new stream reader.
abstract XMLStreamReadercreateXMLStreamReader(String systemId, Reader reader)
Creates a new stream reader.
abstract XMLEventAllocatorgetEventAllocator()
Returns the event allocator.
abstract ObjectgetProperty(String name)
Returns the implementation-specific property of the given name.
abstract XMLReportergetXMLReporter()
Returns the error reporter.
abstract XMLResolvergetXMLResolver()
Returns the entity resolver.
abstract booleanisPropertySupported(String name)
Indicates whether the specified property is supported.
static XMLInputFactorynewInstance()
Creates a new factory instance.
static XMLInputFactorynewInstance(String factoryId, ClassLoader classLoader)
Creates a new factory instance.
abstract voidsetEventAllocator(XMLEventAllocator allocator)
Sets the event allocator.
abstract voidsetProperty(String name, Object value)
Sets the implementation-specific property of the given name.
abstract voidsetXMLReporter(XMLReporter reporter)
Sets the error reporter.
abstract voidsetXMLResolver(XMLResolver resolver)
Sets the entity resolver.

Field Detail

ALLOCATOR

public static final String ALLOCATOR
Property used to control the event allocator implementation.

IS_COALESCING

public static final String IS_COALESCING
Property used to control whether to coalesce adjacent text events.

IS_NAMESPACE_AWARE

public static final String IS_NAMESPACE_AWARE
Property used to control namespace support.

IS_REPLACING_ENTITY_REFERENCES

public static final String IS_REPLACING_ENTITY_REFERENCES
Property used to control whether to replace entity references with their replacement text.

IS_SUPPORTING_EXTERNAL_ENTITIES

public static final String IS_SUPPORTING_EXTERNAL_ENTITIES
Property used to control whether to resolve external entities.

IS_VALIDATING

public static final String IS_VALIDATING
Property used to control DTD validation.

REPORTER

public static final String REPORTER
Property used to control the error reporter implementation.

RESOLVER

public static final String RESOLVER
Property used to control the entity resolver implementation.

SUPPORT_DTD

public static final String SUPPORT_DTD
Property used to indicate whether to support DTDs.

Constructor Detail

XMLInputFactory

protected XMLInputFactory()

Method Detail

createFilteredReader

public abstract XMLStreamReader createFilteredReader(XMLStreamReader reader, StreamFilter filter)
Create a new filtered reader.

createFilteredReader

public abstract XMLEventReader createFilteredReader(XMLEventReader reader, EventFilter filter)
Create a new filtered reader.

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(Reader reader)
Creates a new event reader.

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(String systemId, Reader reader)
Creates a new event reader.

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(XMLStreamReader reader)
Creates a new event reader.

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(Source source)
Creates a new event reader.

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(InputStream stream)
Creates a new event reader.

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(InputStream stream, String encoding)
Creates a new event reader.

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(String systemId, InputStream stream)
Creates a new event reader.

createXMLStreamReader

public abstract XMLStreamReader createXMLStreamReader(Reader reader)
Creates a new stream reader.

createXMLStreamReader

public abstract XMLStreamReader createXMLStreamReader(Source source)
Creates a new stream reader.

createXMLStreamReader

public abstract XMLStreamReader createXMLStreamReader(InputStream stream)
Creates a new stream reader.

createXMLStreamReader

public abstract XMLStreamReader createXMLStreamReader(InputStream stream, String encoding)
Creates a new stream reader.

createXMLStreamReader

public abstract XMLStreamReader createXMLStreamReader(String systemId, InputStream stream)
Creates a new stream reader.

createXMLStreamReader

public abstract XMLStreamReader createXMLStreamReader(String systemId, Reader reader)
Creates a new stream reader.

getEventAllocator

public abstract XMLEventAllocator getEventAllocator()
Returns the event allocator.

getProperty

public abstract Object getProperty(String name)
Returns the implementation-specific property of the given name.

Throws: IllegalArgumentException if the property is not supported

getXMLReporter

public abstract XMLReporter getXMLReporter()
Returns the error reporter.

getXMLResolver

public abstract XMLResolver getXMLResolver()
Returns the entity resolver.

isPropertySupported

public abstract boolean isPropertySupported(String name)
Indicates whether the specified property is supported.

newInstance

public static XMLInputFactory newInstance()
Creates a new factory instance.

See Also: newInstance

newInstance

public static XMLInputFactory newInstance(String factoryId, ClassLoader classLoader)
Creates a new factory instance. The implementation class to load is the first found in the following locations:
  1. the javax.xml.stream.XMLInputFactory system property
  2. the above named property value in the $JAVA_HOME/lib/stax.properties file
  3. the class name specified in the META-INF/services/javax.xml.stream.XMLInputFactory system resource
  4. the default factory class

setEventAllocator

public abstract void setEventAllocator(XMLEventAllocator allocator)
Sets the event allocator.

setProperty

public abstract void setProperty(String name, Object value)
Sets the implementation-specific property of the given name.

Throws: IllegalArgumentException if the property is not supported

setXMLReporter

public abstract void setXMLReporter(XMLReporter reporter)
Sets the error reporter.

setXMLResolver

public abstract void setXMLResolver(XMLResolver resolver)
Sets the entity resolver.