APIdia Launch Partner
Top Description Fields Constructors Methods
javax.xml.transform.stax

public Class StAXResult

extends Object
implements Result
Class Inheritance
All Implemented Interfaces
javax.xml.transform.Result
Imports
javax.xml.stream.XMLEventWriter, .XMLStreamWriter, javax.xml.transform.Result

Acts as a holder for an XML Result in the form of a StAX writer,i.e. XMLStreamWriter or XMLEventWriter. StAXResult can be used in all cases that accept a Result, e.g. javax.xml.transform.Transformer, javax.xml.validation.Validator which accept Result as input.

Authors
Neeraj Bajaj, Jeff Suttor
Since
1.6
See Also
JSR 173: Streaming API for XML, XMLStreamWriter, XMLEventWriter

Field Summary

Modifier and TypeField and Description
public static final String
FEATURE

If javax.xml.transform.TransformerFactory#getFeature(String name) returns true when passed this value as an argument, the Transformer supports Result output of this type.

private String
systemId

System identifier for this StAXResult.

private XMLEventWriter
xmlEventWriter

XMLEventWriter to be used for Result output.

private XMLStreamWriter
xmlStreamWriter

XMLStreamWriter to be used for Result output.

Constructor Summary

AccessConstructor and Description
public
StAXResult(final XMLEventWriter
XMLEventWriter used to create this StAXResult.
xmlEventWriter
)

Creates a new instance of a StAXResult by supplying an XMLEventWriter.

public
StAXResult(final XMLStreamWriter
XMLStreamWriter used to create this StAXResult.
xmlStreamWriter
)

Creates a new instance of a StAXResult by supplying an XMLStreamWriter.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The returned system identifier is always null.
getSystemId
()

Implements javax.xml.transform.Result.getSystemId.

The returned system identifier is always null.

public XMLEventWriter

Returns:

XMLEventWriter used by this StAXResult.
getXMLEventWriter
()

Get the XMLEventWriter used by this StAXResult.

public XMLStreamWriter

Returns:

XMLStreamWriter used by this StAXResult.
getXMLStreamWriter
()

Get the XMLStreamWriter used by this StAXResult.

public void
setSystemId(final String
Ignored.
systemId
)

Implements javax.xml.transform.Result.setSystemId.

In the context of a StAXResult, it is not appropriate to explicitly set the system identifier.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

FEATUREback to summary
public static final String FEATURE

If javax.xml.transform.TransformerFactory#getFeature(String name) returns true when passed this value as an argument, the Transformer supports Result output of this type.

systemIdback to summary
private String systemId

System identifier for this StAXResult.

xmlEventWriterback to summary
private XMLEventWriter xmlEventWriter

XMLEventWriter to be used for Result output.

xmlStreamWriterback to summary
private XMLStreamWriter xmlStreamWriter

XMLStreamWriter to be used for Result output.

Constructor Detail

StAXResultback to summary
public StAXResult(final XMLEventWriter xmlEventWriter)

Creates a new instance of a StAXResult by supplying an XMLEventWriter.

XMLEventWriter must be a non-null reference.

Parameters
xmlEventWriter:XMLEventWriter

XMLEventWriter used to create this StAXResult.

Exceptions
IllegalArgumentException:
If xmlEventWriter == null.
StAXResultback to summary
public StAXResult(final XMLStreamWriter xmlStreamWriter)

Creates a new instance of a StAXResult by supplying an XMLStreamWriter.

XMLStreamWriter must be a non-null reference.

Parameters
xmlStreamWriter:XMLStreamWriter

XMLStreamWriter used to create this StAXResult.

Exceptions
IllegalArgumentException:
If xmlStreamWriter == null.

Method Detail

getSystemIdback to summary
public String getSystemId()

Implements javax.xml.transform.Result.getSystemId.

The returned system identifier is always null.

Returns:String

The returned system identifier is always null.

getXMLEventWriterback to summary
public XMLEventWriter getXMLEventWriter()

Get the XMLEventWriter used by this StAXResult.

XMLEventWriter will be null if this StAXResult was created with a XMLStreamWriter.

Returns:XMLEventWriter

XMLEventWriter used by this StAXResult.

getXMLStreamWriterback to summary
public XMLStreamWriter getXMLStreamWriter()

Get the XMLStreamWriter used by this StAXResult.

XMLStreamWriter will be null if this StAXResult was created with a XMLEventWriter.

Returns:XMLStreamWriter

XMLStreamWriter used by this StAXResult.

setSystemIdback to summary
public void setSystemId(final String systemId)

Implements javax.xml.transform.Result.setSystemId.

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 is always thrown by this method.

Parameters
systemId:String

Ignored.

Exceptions
UnsupportedOperationException:
Is always thrown by this method.