Package javanet.staxutils
Class StAXResult
- java.lang.Object
-
- javax.xml.transform.sax.SAXResult
-
- javanet.staxutils.StAXResult
-
- All Implemented Interfaces:
Result
public class StAXResult extends SAXResult
A JAXPResultimplementation that produces a result on the specifiedXMLStreamWriterorXMLEventWriter.Please note that you may need to call flush() on the underlying XMLStreamWriter or XMLEventWriter after the transform is complete.
The fact that JAXBResult derives from SAXResult is an implementation detail. Thus in general applications are strongly discouraged from accessing methods defined on SAXResult.
In particular it shall never attempt to call the following methods:
- setHandler
- setLexicalHandler
- setSystemId
Example:
// create a DOMSource Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(...); Source domSource = new DOMSource(doc); // create a StAXResult XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(System.out); Result staxResult = new StAXResult(writer); // run the transform TransformerFactory.newInstance().newTransformer().transform(domSource, staxResult);- Version:
- 1.0
- Author:
- Ryan.Shoemaker@Sun.COM
-
-
Field Summary
-
Fields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
-
-
Constructor Summary
Constructors Constructor Description StAXResult(XMLEventWriter writer)Create a newResultthat produces a result on the specifiedXMLEventWriterStAXResult(XMLStreamWriter writer)Create a newResultthat produces a result on the specifiedXMLStreamWriter
-
Method Summary
-
Methods inherited from class javax.xml.transform.sax.SAXResult
getHandler, getLexicalHandler, getSystemId, setHandler, setLexicalHandler, setSystemId
-
-
-
-
Constructor Detail
-
StAXResult
public StAXResult(XMLStreamWriter writer)
Create a newResultthat produces a result on the specifiedXMLStreamWriter- Parameters:
writer- the XMLStreamWriter- Throws:
IllegalArgumentException- iff the writer is null
-
StAXResult
public StAXResult(XMLEventWriter writer)
Create a newResultthat produces a result on the specifiedXMLEventWriter- Parameters:
writer- the XMLEventWriter- Throws:
IllegalArgumentException- iff the writer is null
-
-