Top Description Fields Constructors Methods
org.codehaus.stax2.io

public abstract Class Stax2Result

extends Object
implements Result
Class Inheritance
All Implemented Interfaces
javax.xml.transform.Result
Known Direct Subclasses
org.codehaus.stax2.io.Stax2BlockResult, org.codehaus.stax2.io.Stax2ReferentialResult
Imports
java.io.OutputStream, .IOException, .Writer, javax.xml.transform.Result

This is the base class for additional output results (implementations of javax.xml.transform.Result) that Stax2 org.codehaus.stax2.XMLInputFactory2 implementations should support.

Note about usage by the parser factory implementations: the expectation is that at least one of methods constructWriter and constructOutputStream will succeed, but not necessarily both. This generally depends on type of resource being represented: for example, if the source is a StringBuffer, it is most naturally represent via Writer. For File-backed results, on the other hand, an OutputStream is the most natural access method.

Other things to note about using result Writers and OutputStreams:

Field Summary

Modifier and TypeField and Description
protected String
protected String
protected String

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public abstract OutputStream
constructOutputStream()

This method creates an OutputStream via which underlying output target can be written to.

public abstract Writer
constructWriter()

This method creates a Writer via which underlying output target can be written to.

public String
public String
public String
getSystemId()

Implements javax.xml.transform.Result.getSystemId.

Get the system identifier that was set with setSystemId.
public void
public void
public void
setSystemId(String
The system identifier as a URI string.
id
)

Implements javax.xml.transform.Result.setSystemId.

Set the system identifier for this Result.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mEncodingback to summary
protected String mEncoding
mPublicIdback to summary
protected String mPublicId
mSystemIdback to summary
protected String mSystemId

Constructor Detail

Stax2Resultback to summary
protected Stax2Result()

Method Detail

constructOutputStreamback to summary
public abstract OutputStream constructOutputStream() throws IOException

This method creates an OutputStream via which underlying output target can be written to. Note that caller is responsible for closing that OutputStream when it is done reading it

constructWriterback to summary
public abstract Writer constructWriter() throws IOException

This method creates a Writer via which underlying output target can be written to. Note that caller is responsible for closing that Writer when it is done reading it.

getEncodingback to summary
public String getEncoding()
getPublicIdback to summary
public String getPublicId()
getSystemIdback to summary
public String getSystemId()

Implements javax.xml.transform.Result.getSystemId.

Doc from javax.xml.transform.Result.getSystemId.

Get the system identifier that was set with setSystemId.

Returns:String

The system identifier that was set with setSystemId, or null if setSystemId was not called.

Annotations
@Override
setEncodingback to summary
public void setEncoding(String enc)
setPublicIdback to summary
public void setPublicId(String id)
setSystemIdback to summary
public void setSystemId(String id)

Implements javax.xml.transform.Result.setSystemId.

Doc from javax.xml.transform.Result.setSystemId.

Set the system identifier for this Result.

If the Result is not to be written to a file, the system identifier is optional. The application may still want to provide one, however, for use in error messages and warnings, or to resolve relative output identifiers.

Parameters
id:String

The system identifier as a URI string.

Annotations
@Override