|
Java EE 5 SDK 深圳电信培训中心.徐海蛟老师. |
||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 |
javax.xml.stream Class XMLInputFactory
java.lang.Object javax.xml.stream.XMLInputFactory
public abstract class XMLInputFactory
- extends Object
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 |
- 版本:
- 1.0
- 作者:
- Copyright (c) 2003 by BEA Systems. All Rights Reserved.
- 另请参见:
XMLOutputFactory
,XMLEventReader
,XMLStreamReader
,EventFilter
,XMLReporter
,XMLResolver
,XMLEventAllocator
字段摘要 | |
---|---|
static String |
ALLOCATOR
The property used to set/get the implementation of the allocator |
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 |
REPORTER
The property used to set/get the implementation of the XMLReporter interface |
static String |
RESOLVER
The property used to set/get the implementation of the XMLResolver |
static String |
SUPPORT_DTD
The property that requires the parser to support DTDs |
构造器摘要 | |
---|---|
protected |
XMLInputFactory()
|
方法摘要 | |
---|---|
abstract XMLEventReader |
createFilteredReader(XMLEventReader reader,
EventFilter filter)
Create a filtered event reader that wraps the filter around the event reader |
abstract XMLStreamReader |
createFilteredReader(XMLStreamReader reader,
StreamFilter filter)
Create a filtered reader that wraps the filter around the reader |
abstract XMLEventReader |
createXMLEventReader(InputStream stream)
Create a new XMLEventReader from a java.io.InputStream |
abstract XMLEventReader |
createXMLEventReader(InputStream stream,
String encoding)
Create a new XMLEventReader from a java.io.InputStream |
abstract XMLEventReader |
createXMLEventReader(Reader reader)
Create a new XMLEventReader from a reader |
abstract XMLEventReader |
createXMLEventReader(Source source)
Create a new XMLEventReader from a JAXP source. |
abstract XMLEventReader |
createXMLEventReader(String systemId,
InputStream stream)
Create a new XMLEventReader from a java.io.InputStream |
abstract XMLEventReader |
createXMLEventReader(String systemId,
Reader reader)
Create a new XMLEventReader from a reader |
abstract XMLEventReader |
createXMLEventReader(XMLStreamReader reader)
Create a new XMLEventReader from an XMLStreamReader. |
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 XMLStreamReader |
createXMLStreamReader(Source source)
Create a new XMLStreamReader from a JAXP source. |
abstract XMLStreamReader |
createXMLStreamReader(String systemId,
InputStream stream)
Create a new XMLStreamReader from a java.io.InputStream |
abstract XMLStreamReader |
createXMLStreamReader(String systemId,
Reader reader)
Create a new XMLStreamReader from a java.io.InputStream |
abstract XMLEventAllocator |
getEventAllocator()
Gets the allocator used by streams created with this factory |
abstract Object |
getProperty(String name)
Get the value of a feature/property from the underlying implementation |
abstract XMLReporter |
getXMLReporter()
The reporter that will be set on any XMLStreamReader or XMLEventReader created by this factory instance. |
abstract XMLResolver |
getXMLResolver()
The resolver that will be set on any XMLStreamReader or XMLEventReader 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. |
static XMLInputFactory |
newInstance(String factoryId,
ClassLoader classLoader)
Create a new instance of the factory |
abstract void |
setEventAllocator(XMLEventAllocator allocator)
Set a user defined event allocator for events |
abstract void |
setProperty(String name,
Object value)
Allows the user to set specific feature/property on the underlying implementation. |
abstract void |
setXMLReporter(XMLReporter reporter)
The reporter that will be set on any XMLStreamReader or XMLEventReader created by this factory instance. |
abstract void |
setXMLResolver(XMLResolver resolver)
The resolver that will be set on any XMLStreamReader or XMLEventReader created by this factory instance. |
类方法继承 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
字段详细信息 |
---|
IS_NAMESPACE_AWARE
public static final 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
- 另请参见:
- 常量字段
IS_VALIDATING
public static final String IS_VALIDATING
- The property used to turn on/off implementation specific validation
- 另请参见:
- 常量字段
IS_COALESCING
public static final String IS_COALESCING
- The property that requires the parser to coalesce adjacent character data sections
- 另请参见:
- 常量字段
IS_REPLACING_ENTITY_REFERENCES
public static final String IS_REPLACING_ENTITY_REFERENCES
- Requires the parser to replace internal
entity references with their replacement
text and report them as characters
- 另请参见:
- 常量字段
IS_SUPPORTING_EXTERNAL_ENTITIES
public static final String IS_SUPPORTING_EXTERNAL_ENTITIES
- The property that requires the parser to resolve external parsed entities
- 另请参见:
- 常量字段
SUPPORT_DTD
public static final String SUPPORT_DTD
- The property that requires the parser to support DTDs
- 另请参见:
- 常量字段
REPORTER
public static final String REPORTER
- The property used to
set/get the implementation of the XMLReporter interface
- 另请参见:
- 常量字段
RESOLVER
public static final String RESOLVER
- The property used to set/get the implementation of the XMLResolver
- 另请参见:
- 常量字段
ALLOCATOR
public static final String ALLOCATOR
- The property used to set/get the implementation of the allocator
- 另请参见:
- 常量字段
构造器详细信息 |
---|
XMLInputFactory
protected XMLInputFactory()
方法详细信息 |
---|
newInstance
public static XMLInputFactory newInstance() throws FactoryConfigurationError
- 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.
- 抛出异常:
FactoryConfigurationError
- if an instance of this factory cannot be loaded
newInstance
public static XMLInputFactory newInstance(String factoryId, ClassLoader classLoader) throws FactoryConfigurationError
- Create a new instance of the factory
- 参数:
factoryId
- Name of the factory to find, same as a property nameclassLoader
- classLoader to use- 返回:
- the factory implementation
- 抛出异常:
FactoryConfigurationError
- if an instance of this factory cannot be loaded
createXMLStreamReader
public abstract XMLStreamReader createXMLStreamReader(Reader reader) throws XMLStreamException
- Create a new XMLStreamReader from a reader
- 参数:
reader
- the XML data to read from- 抛出异常:
XMLStreamException
createXMLStreamReader
public abstract XMLStreamReader createXMLStreamReader(Source source) throws 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 XMLInputFactoryXMLStreamException
createXMLStreamReader
public abstract XMLStreamReader createXMLStreamReader(InputStream stream) throws XMLStreamException
- Create a new XMLStreamReader from a java.io.InputStream
- 参数:
stream
- the InputStream to read from- 抛出异常:
XMLStreamException
createXMLStreamReader
public abstract XMLStreamReader createXMLStreamReader(InputStream stream, String encoding) throws XMLStreamException
- Create a new XMLStreamReader from a java.io.InputStream
- 参数:
stream
- the InputStream to read fromencoding
- the character encoding of the stream- 抛出异常:
XMLStreamException
createXMLStreamReader
public abstract XMLStreamReader createXMLStreamReader(String systemId, InputStream stream) throws XMLStreamException
- Create a new XMLStreamReader from a java.io.InputStream
- 参数:
systemId
- the system ID of the streamstream
- the InputStream to read from- 抛出异常:
XMLStreamException
createXMLStreamReader
public abstract XMLStreamReader createXMLStreamReader(String systemId, Reader reader) throws XMLStreamException
- Create a new XMLStreamReader from a java.io.InputStream
- 参数:
systemId
- the system ID of the streamreader
- the InputStream to read from- 抛出异常:
XMLStreamException
createXMLEventReader
public abstract XMLEventReader createXMLEventReader(Reader reader) throws XMLStreamException
- Create a new XMLEventReader from a reader
- 参数:
reader
- the XML data to read from- 抛出异常:
XMLStreamException
createXMLEventReader
public abstract XMLEventReader createXMLEventReader(String systemId, Reader reader) throws XMLStreamException
- Create a new XMLEventReader from a reader
- 参数:
systemId
- the system ID of the inputreader
- the XML data to read from- 抛出异常:
XMLStreamException
createXMLEventReader
public abstract XMLEventReader createXMLEventReader(XMLStreamReader reader) throws 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)- 返回:
- a new XMLEventReader
- 抛出异常:
XMLStreamException
createXMLEventReader
public abstract XMLEventReader createXMLEventReader(Source source) throws 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 XMLInputFactoryXMLStreamException
createXMLEventReader
public abstract XMLEventReader createXMLEventReader(InputStream stream) throws XMLStreamException
- Create a new XMLEventReader from a java.io.InputStream
- 参数:
stream
- the InputStream to read from- 抛出异常:
XMLStreamException
createXMLEventReader
public abstract XMLEventReader createXMLEventReader(InputStream stream, String encoding) throws XMLStreamException
- Create a new XMLEventReader from a java.io.InputStream
- 参数:
stream
- the InputStream to read fromencoding
- the character encoding of the stream- 抛出异常:
XMLStreamException
createXMLEventReader
public abstract XMLEventReader createXMLEventReader(String systemId, InputStream stream) throws XMLStreamException
- Create a new XMLEventReader from a java.io.InputStream
- 参数:
systemId
- the system ID of the streamstream
- the InputStream to read from- 抛出异常:
XMLStreamException
createFilteredReader
public abstract XMLStreamReader createFilteredReader(XMLStreamReader reader, StreamFilter filter) throws XMLStreamException
- Create a filtered reader that wraps the filter around the reader
- 参数:
reader
- the reader to filterfilter
- the filter to apply to the reader- 抛出异常:
XMLStreamException
createFilteredReader
public abstract XMLEventReader createFilteredReader(XMLEventReader reader, EventFilter filter) throws XMLStreamException
- Create a filtered event reader that wraps the filter around the event reader
- 参数:
reader
- the event reader to wrapfilter
- the filter to apply to the event reader- 抛出异常:
XMLStreamException
getXMLResolver
public abstract XMLResolver getXMLResolver()
- The resolver that will be set on any XMLStreamReader or XMLEventReader created
by this factory instance.
setXMLResolver
public abstract void setXMLResolver(XMLResolver resolver)
- The resolver that will be set on any XMLStreamReader or XMLEventReader created
by this factory instance.
- 参数:
resolver
- the resolver to use to resolve references
getXMLReporter
public abstract XMLReporter getXMLReporter()
- The reporter that will be set on any XMLStreamReader or XMLEventReader created
by this factory instance.
setXMLReporter
public abstract void setXMLReporter(XMLReporter reporter)
- 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
setProperty
public abstract void setProperty(String name, Object value) throws IllegalArgumentException
- 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
getProperty
public abstract Object getProperty(String name) throws IllegalArgumentException
- Get the value of a feature/property from the underlying implementation
- 参数:
name
- The name of the property (may not be null)- 返回:
- The value of the property
- 抛出异常:
IllegalArgumentException
- if the property is not supported
isPropertySupported
public abstract boolean isPropertySupported(String name)
- Query the set of properties that this factory supports.
- 参数:
name
- The name of the property (may not be null)- 返回:
- true if the property is supported and false otherwise
setEventAllocator
public abstract void setEventAllocator(XMLEventAllocator allocator)
- Set a user defined event allocator for events
- 参数:
allocator
- the user defined allocator
getEventAllocator
public abstract XMLEventAllocator getEventAllocator()
- Gets the allocator used by streams created with this factory
|
Java EE 5 SDK 深圳电信培训中心.徐海蛟老师. |
||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 |
提交错误或意见
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.