javax.xml.transform.stream
Class StreamResult
java.lang.Object
javax.xml.transform.stream.StreamResult
- Result
public class StreamResult
extends java.lang.Object
Specifies a stream to which to write the transformation result.
static String | FEATURE - Factory feature indicating that stream results are supported.
|
FEATURE
public static final String FEATURE
Factory feature indicating that stream results are supported.
StreamResult
public StreamResult()
Default constructor.
StreamResult
public StreamResult(File file)
Constructor with a system ID specified as a File object.
StreamResult
public StreamResult(OutputStream stream)
Constructor with an output stream.
StreamResult
public StreamResult(String systemID)
Constructor with a system ID.
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.
getOutputStream
public OutputStream getOutputStream()
Returns the target output stream.
getSystemId
public String getSystemId()
Returns the system ID.
- getSystemId in interface Result
getWriter
public Writer getWriter()
Returns the target writer.
setOutputStream
public void setOutputStream(OutputStream outputStream)
Sets the target output stream.
setSystemId
public void setSystemId(File f)
Sets the system ID from a File reference.
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 in interface Result
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.