StAXResult (Java SE 9 & JDK 9 ) (original) (raw)
- javax.xml.transform.stax.StAXResult
All Implemented Interfaces:
[Result](../../../../javax/xml/transform/Result.html "interface in javax.xml.transform")
public class StAXResult
extends Object
implements Result
Since:
1.6
See Also:
JSR 173: Streaming API for XML, XMLStreamWriter, XMLEventWriter
Field Summary
Fields
Modifier and Type Field Description static String FEATURE If TransformerFactory.getFeature(String name) returns true when passed this value as an argument, the Transformer supports Result output of this type. * ### Fields inherited from interface javax.xml.transform.[Result](../../../../javax/xml/transform/Result.html "interface in javax.xml.transform") `[PI_DISABLE_OUTPUT_ESCAPING](../../../../javax/xml/transform/Result.html#PI%5FDISABLE%5FOUTPUT%5FESCAPING), [PI_ENABLE_OUTPUT_ESCAPING](../../../../javax/xml/transform/Result.html#PI%5FENABLE%5FOUTPUT%5FESCAPING)`
Constructor Summary
Constructors
Constructor Description StAXResult(XMLEventWriter xmlEventWriter) Creates a new instance of a StAXResult by supplying an XMLEventWriter. StAXResult(XMLStreamWriter xmlStreamWriter) Creates a new instance of a StAXResult by supplying an XMLStreamWriter. Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type Method Description String getSystemId() The returned system identifier is always null. XMLEventWriter getXMLEventWriter() Get the XMLEventWriter used by thisStAXResult. XMLStreamWriter getXMLStreamWriter() Get the XMLStreamWriter used by thisStAXResult. void setSystemId(String systemId) In the context of a StAXResult, it is not appropriate to explicitly set the system identifier. * ### Methods inherited from class java.lang.[Object](../../../../java/lang/Object.html "class in java.lang") `[clone](../../../../java/lang/Object.html#clone--), [equals](../../../../java/lang/Object.html#equals-java.lang.Object-), [finalize](../../../../java/lang/Object.html#finalize--), [getClass](../../../../java/lang/Object.html#getClass--), [hashCode](../../../../java/lang/Object.html#hashCode--), [notify](../../../../java/lang/Object.html#notify--), [notifyAll](../../../../java/lang/Object.html#notifyAll--), [toString](../../../../java/lang/Object.html#toString--), [wait](../../../../java/lang/Object.html#wait--), [wait](../../../../java/lang/Object.html#wait-long-), [wait](../../../../java/lang/Object.html#wait-long-int-)`
Field Detail
* #### FEATURE public static final [String](../../../../java/lang/String.html "class in java.lang") FEATURE See Also: [Constant Field Values](../../../../constant-values.html#javax.xml.transform.stax.StAXResult.FEATURE)
Constructor Detail
* #### StAXResult public StAXResult([XMLEventWriter](../../../../javax/xml/stream/XMLEventWriter.html "interface in javax.xml.stream") xmlEventWriter) Creates a new instance of a `StAXResult` by supplying an [XMLEventWriter](../../../../javax/xml/stream/XMLEventWriter.html "interface in javax.xml.stream"). `XMLEventWriter` must be a non-`null` reference. Parameters: `xmlEventWriter` \- `XMLEventWriter` used to create this `StAXResult`. Throws: `[IllegalArgumentException](../../../../java/lang/IllegalArgumentException.html "class in java.lang")` \- If `xmlEventWriter` \==`null`. * #### StAXResult public StAXResult([XMLStreamWriter](../../../../javax/xml/stream/XMLStreamWriter.html "interface in javax.xml.stream") xmlStreamWriter) Creates a new instance of a `StAXResult` by supplying an [XMLStreamWriter](../../../../javax/xml/stream/XMLStreamWriter.html "interface in javax.xml.stream"). `XMLStreamWriter` must be a non-`null` reference. Parameters: `xmlStreamWriter` \- `XMLStreamWriter` used to create this `StAXResult`. Throws: `[IllegalArgumentException](../../../../java/lang/IllegalArgumentException.html "class in java.lang")` \- If `xmlStreamWriter` \==`null`.
Method Detail
* #### getXMLEventWriter public [XMLEventWriter](../../../../javax/xml/stream/XMLEventWriter.html "interface in javax.xml.stream") getXMLEventWriter() Get the `XMLEventWriter` used by this`StAXResult`. `XMLEventWriter` will be `null` if this `StAXResult` was created with a`XMLStreamWriter`. Returns: `XMLEventWriter` used by this`StAXResult`. * #### getXMLStreamWriter public [XMLStreamWriter](../../../../javax/xml/stream/XMLStreamWriter.html "interface in javax.xml.stream") getXMLStreamWriter() Get the `XMLStreamWriter` used by this`StAXResult`. `XMLStreamWriter` will be `null` if this `StAXResult` was created with a`XMLEventWriter`. Returns: `XMLStreamWriter` used by this`StAXResult`. * #### setSystemId public void setSystemId([String](../../../../java/lang/String.html "class in java.lang") systemId) In the context of a `StAXResult`, it is not appropriate to explicitly set the system identifier. The `XMLEventWriter` or `XMLStreamWriter` used to construct this `StAXResult` determines the system identifier of the XML result. An [UnsupportedOperationException](../../../../java/lang/UnsupportedOperationException.html "class in java.lang") is **always** thrown by this method. Specified by: `[setSystemId](../../../../javax/xml/transform/Result.html#setSystemId-java.lang.String-)` in interface `[Result](../../../../javax/xml/transform/Result.html "interface in javax.xml.transform")` Parameters: `systemId` \- Ignored. Throws: `[UnsupportedOperationException](../../../../java/lang/UnsupportedOperationException.html "class in java.lang")` \- Is **always** thrown by this method. * #### getSystemId public [String](../../../../java/lang/String.html "class in java.lang") getSystemId() The returned system identifier is always `null`. Specified by: `[getSystemId](../../../../javax/xml/transform/Result.html#getSystemId--)` in interface `[Result](../../../../javax/xml/transform/Result.html "interface in javax.xml.transform")` Returns: The returned system identifier is always `null`.
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2017, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.