类 StaxSource

java.lang.Object
javax.xml.transform.sax.SAXSource
cn.taketoday.util.xml.StaxSource
所有已实现的接口:
Source

class StaxSource extends SAXSource
Implementation of the 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

      StaxSource(XMLEventReader eventReader)
      Construct a new instance of the StaxSource with the specified XMLEventReader. The supplied event reader must be in XMLStreamConstants.START_DOCUMENT or XMLStreamConstants.START_ELEMENT state.
      参数:
      eventReader - the XMLEventReader to 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 the StaxSource with the specified XMLStreamReader. The supplied stream reader must be in XMLStreamConstants.START_DOCUMENT or XMLStreamConstants.START_ELEMENT state.
      参数:
      streamReader - the XMLStreamReader to read from
      抛出:
      IllegalStateException - if the reader is not at the start of a document or element
  • 方法详细资料