javax.xml.transform.stream

Class StreamResult

public class StreamResult extends Object implements Result

Specifies a stream to which to write the transformation result.
Field Summary
static StringFEATURE
Factory feature indicating that stream results are supported.
Constructor Summary
StreamResult()
Default constructor.
StreamResult(OutputStream stream)
Constructor with an output stream.
StreamResult(Writer writer)
Constructor with a writer.
StreamResult(String systemID)
Constructor with a system ID.
StreamResult(File file)
Constructor with a system ID specified as a File object.
Method Summary
OutputStreamgetOutputStream()
Returns the target output stream.
StringgetSystemId()
Returns the system ID.
WritergetWriter()
Returns the target writer.
voidsetOutputStream(OutputStream outputStream)
Sets the target output stream.
voidsetSystemId(String systemID)
Sets the system ID.
voidsetSystemId(File f)
Sets the system ID from a File reference.
voidsetWriter(Writer writer)
Sets the target writer.

Field Detail

FEATURE

public static final String FEATURE
Factory feature indicating that stream results are supported.

Constructor Detail

StreamResult

public StreamResult()
Default constructor.

StreamResult

public StreamResult(OutputStream stream)
Constructor with an output stream.

StreamResult

public StreamResult(Writer writer)
Constructor with a writer. Prefer to use an output stream rather than a writer, so that the output encoding can be controlled by transformation properties.

StreamResult

public StreamResult(String systemID)
Constructor with a system ID.

StreamResult

public StreamResult(File file)
Constructor with a system ID specified as a File object.

Method Detail

getOutputStream

public OutputStream getOutputStream()
Returns the target output stream.

getSystemId

public String getSystemId()
Returns the system ID.

getWriter

public Writer getWriter()
Returns the target writer.

setOutputStream

public void setOutputStream(OutputStream outputStream)
Sets the target output stream.

setSystemId

public void setSystemId(String systemID)
Sets the system ID. If neither the out stream nor the writer have been specified, the system ID will be treated as a URL for writing to.

setSystemId

public void setSystemId(File f)
Sets the system ID from a File reference.

setWriter

public void setWriter(Writer writer)
Sets the target writer. Prefer to use an output stream rather than a writer, so that the output encoding can be controlled by transformation properties.