类 StaxSource
- 所有已实现的接口:
Source
Source tagging interface for StAX readers. Can be constructed with
an XMLEventReader or an XMLStreamReader.
This class is necessary because there is no implementation of Source for StAX Readers
in JAXP 1.3. There is a StAXSource in JAXP 1.4 (JDK 1.6), but this class is kept around
for backwards compatibility reasons.
Even though StaxSource extends from SAXSource, calling the methods of
SAXSource is not supported. In general, the only supported operation
on this class is to use the XMLReader obtained via SAXSource.getXMLReader() to parse the
input source obtained via SAXSource.getInputSource(). Calling setXMLReader(XMLReader)
or setInputSource(InputSource) will result in UnsupportedOperationException #setInputSource(InputSource) will result in UnsupportedOperationExceptions.
- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma
- 另请参阅:
-
字段概要
字段 -
构造器概要
构造器构造器说明StaxSource(XMLEventReader eventReader) Construct a new instance of theStaxSourcewith the specifiedXMLEventReader.StaxSource(XMLStreamReader streamReader) Construct a new instance of theStaxSourcewith the specifiedXMLStreamReader. -
方法概要
修饰符和类型方法说明(专用程序包) XMLEventReaderReturn theXMLEventReaderused by thisStaxSource.(专用程序包) XMLStreamReaderReturn theXMLStreamReaderused by thisStaxSource.voidsetInputSource(InputSource inputSource) Throws anUnsupportedOperationException.voidsetXMLReader(XMLReader reader) Throws anUnsupportedOperationException.从类继承的方法 javax.xml.transform.sax.SAXSource
getInputSource, getSystemId, getXMLReader, isEmpty, setSystemId, sourceToInputSource
-
字段详细资料
-
eventReader
-
streamReader
-
-
构造器详细资料
-
StaxSource
StaxSource(XMLEventReader eventReader) Construct a new instance of theStaxSourcewith the specifiedXMLEventReader. The supplied event reader must be inXMLStreamConstants.START_DOCUMENTorXMLStreamConstants.START_ELEMENTstate.- 参数:
eventReader- theXMLEventReaderto read from- 抛出:
IllegalStateException- if the reader is not at the start of a document or element
-
StaxSource
StaxSource(XMLStreamReader streamReader) Construct a new instance of theStaxSourcewith the specifiedXMLStreamReader. The supplied stream reader must be inXMLStreamConstants.START_DOCUMENTorXMLStreamConstants.START_ELEMENTstate.- 参数:
streamReader- theXMLStreamReaderto read from- 抛出:
IllegalStateException- if the reader is not at the start of a document or element
-
-
方法详细资料
-
getXMLEventReader
Return theXMLEventReaderused by thisStaxSource.If this
StaxSourcewas created with anXMLStreamReader, the result will benull.- 返回:
- the StAX event reader used by this source
- 另请参阅:
-
getXMLStreamReader
Return theXMLStreamReaderused by thisStaxSource.If this
StaxSourcewas created with anXMLEventReader, the result will benull.- 返回:
- the StAX event reader used by this source
- 另请参阅:
-
setInputSource
Throws anUnsupportedOperationException.- 覆盖:
setInputSource在类中SAXSource- 抛出:
UnsupportedOperationException- always
-
setXMLReader
Throws anUnsupportedOperationException.- 覆盖:
setXMLReader在类中SAXSource- 抛出:
UnsupportedOperationException- always
-