public abstract class XMLInputFactory extends Object
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.resolver | sets/gets the impl of the XMLResolver interface | javax.xml.stream.XMLResolver | Null | Yes |
XMLOutputFactory
,
XMLStreamReader
Modifier and Type | Field and Description |
---|---|
static String |
IS_COALESCING
The property that requires the parser to coalesce adjacent character data
sections
|
static 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 |
static String |
IS_REPLACING_ENTITY_REFERENCES
Requires the parser to replace internal
entity references with their replacement
text and report them as characters
|
static String |
IS_SUPPORTING_EXTERNAL_ENTITIES
The property that requires the parser to resolve external parsed entities
|
static String |
IS_VALIDATING
The property used to turn on/off implementation specific validation
|
static String |
RESOLVER |
static String |
SUPPORT_DTD
The property that requires the parser to support DTDs
|
Modifier | Constructor and Description |
---|---|
protected |
XMLInputFactory() |
Modifier and Type | Method and Description |
---|---|
abstract XMLStreamReader |
createXMLStreamReader(InputStream stream)
Create a new XMLStreamReader from a java.io.InputStream
|
abstract XMLStreamReader |
createXMLStreamReader(InputStream stream,
String encoding)
Create a new XMLStreamReader from a java.io.InputStream
|
abstract XMLStreamReader |
createXMLStreamReader(Reader reader)
Create a new XMLStreamReader from a reader
|
abstract Object |
getProperty(String name)
Get the value of a feature/property from the underlying implementation
|
abstract XMLResolver |
getXMLResolver()
The resolver that will be set on any XMLStreamReader created
by this factory instance.
|
abstract boolean |
isPropertySupported(String name)
Query the set of properties that this factory supports.
|
static XMLInputFactory |
newInstance()
Create a new instance of the factory.
|
abstract void |
setProperty(String name,
Object value)
Allows the user to set specific feature/property on the underlying
implementation.
|
abstract void |
setXMLResolver(XMLResolver resolver)
The resolver that will be set on any XMLStreamReader created
by this factory instance.
|
public static final String IS_NAMESPACE_AWARE
true
setting must be supportedpublic static final String IS_VALIDATING
public static final String IS_COALESCING
public static final String IS_REPLACING_ENTITY_REFERENCES
public static final String IS_SUPPORTING_EXTERNAL_ENTITIES
public static final String SUPPORT_DTD
public static final String RESOLVER
public static XMLInputFactory newInstance() throws FactoryConfigurationError
FactoryConfigurationError
- if an instance of this factory cannot be
loadedpublic abstract XMLStreamReader createXMLStreamReader(Reader reader) throws XMLStreamException
reader
- the XML data to read from, may not be nullXMLStreamException
public abstract XMLStreamReader createXMLStreamReader(InputStream stream) throws XMLStreamException
stream
- the InputStream to read fromXMLStreamException
public abstract XMLStreamReader createXMLStreamReader(InputStream stream, String encoding) throws XMLStreamException
stream
- the InputStream to read fromencoding
- the character encoding of the streamXMLStreamException
public abstract XMLResolver getXMLResolver()
public abstract void setXMLResolver(XMLResolver resolver)
resolver
- the resolver to use to resolve referencespublic abstract void setProperty(String name, Object value) throws IllegalArgumentException
name
- The name of the property (may not be null
)value
- The value of the propertyIllegalArgumentException
- if the property is not
supportedpublic abstract Object getProperty(String name) throws IllegalArgumentException
name
- The name of the property (may not be null
)IllegalArgumentException
- if the property is not supportedpublic abstract boolean isPropertySupported(String name)
name
- The name of the property (may not be null
)true
if the property is supported and
false
otherwise