类 StaxResult
- 所有已实现的接口:
Result
Result tagging interface for StAX writers. Can be constructed with
an XMLEventConsumer or an XMLStreamWriter.
This class is necessary because there is no implementation of Source for StaxReaders
in JAXP 1.3. There is a StAXResult in JAXP 1.4 (JDK 1.6), but this class is kept around
for backwards compatibility reasons.
Even though StaxResult extends from SAXResult, calling the methods of
SAXResult is not supported. In general, the only supported operation
on this class is to use the ContentHandler obtained via SAXResult.getHandler() to parse an
input source using an XMLReader. Calling setHandler(ContentHandler)
or setLexicalHandler(LexicalHandler) will result in
UnsupportedOperationExceptions.
- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma
- 另请参阅:
-
字段概要
字段从接口继承的字段 javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING -
构造器概要
构造器构造器说明StaxResult(XMLEventWriter eventWriter) Construct a new instance of theStaxResultwith the specifiedXMLEventWriter.StaxResult(XMLStreamWriter streamWriter) Construct a new instance of theStaxResultwith the specifiedXMLStreamWriter. -
方法概要
修饰符和类型方法说明Return theXMLEventWriterused by thisStaxResult.Return theXMLStreamWriterused by thisStaxResult.voidsetHandler(ContentHandler handler) Throws anUnsupportedOperationException.voidsetLexicalHandler(LexicalHandler handler) Throws anUnsupportedOperationException.从类继承的方法 javax.xml.transform.sax.SAXResult
getHandler, getLexicalHandler, getSystemId, setSystemId
-
字段详细资料
-
eventWriter
-
streamWriter
-
-
构造器详细资料
-
StaxResult
Construct a new instance of theStaxResultwith the specifiedXMLEventWriter.- 参数:
eventWriter- theXMLEventWriterto write to
-
StaxResult
Construct a new instance of theStaxResultwith the specifiedXMLStreamWriter.- 参数:
streamWriter- theXMLStreamWriterto write to
-
-
方法详细资料
-
getXMLEventWriter
Return theXMLEventWriterused by thisStaxResult.If this
StaxResultwas created with anXMLStreamWriter, the result will benull.- 返回:
- the StAX event writer used by this result
- 另请参阅:
-
getXMLStreamWriter
Return theXMLStreamWriterused by thisStaxResult.If this
StaxResultwas created with anXMLEventConsumer, the result will benull.- 返回:
- the StAX stream writer used by this result
- 另请参阅:
-
setHandler
Throws anUnsupportedOperationException.- 覆盖:
setHandler在类中SAXResult- 抛出:
UnsupportedOperationException- always
-
setLexicalHandler
Throws anUnsupportedOperationException.- 覆盖:
setLexicalHandler在类中SAXResult- 抛出:
UnsupportedOperationException- always
-