javax.xml.transform.stream
Class StreamResult

java.lang.Object
  extended by javax.xml.transform.stream.StreamResult
All Implemented Interfaces:
Result

public class StreamResult
extends Object
implements Result

Specifies a stream to which to write the transformation result.


Field Summary
static String FEATURE
          Factory feature indicating that stream results are supported.
 
Fields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
 
Constructor Summary
StreamResult()
          Default constructor.
StreamResult(File file)
          Constructor with a system ID specified as a File object.
StreamResult(OutputStream stream)
          Constructor with an output stream.
StreamResult(String systemID)
          Constructor with a system ID.
StreamResult(Writer writer)
          Constructor with a writer.
 
Method Summary
 OutputStream getOutputStream()
          Returns the target output stream.
 String getSystemId()
          Returns the system ID.
 Writer getWriter()
          Returns the target writer.
 void setOutputStream(OutputStream outputStream)
          Sets the target output stream.
 void setSystemId(File f)
          Sets the system ID from a File reference.
 void setSystemId(String systemID)
          Sets the system ID.
 void setWriter(Writer writer)
          Sets the target writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FEATURE

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

See Also:
Constant Field Values
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

setOutputStream

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


getOutputStream

public OutputStream getOutputStream()
Returns the target output stream.


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.


getWriter

public Writer getWriter()
Returns the target writer.


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.

Specified by:
setSystemId in interface Result
Parameters:
systemID - the system ID URI

setSystemId

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


getSystemId

public String getSystemId()
Returns the system ID.

Specified by:
getSystemId in interface Result