org.enhydra.zeus.result
Class StreamResult

java.lang.Object
  |
  +--org.enhydra.zeus.result.BaseResult
        |
        +--org.enhydra.zeus.result.StreamResult
All Implemented Interfaces:
Result

public class StreamResult
extends BaseResult

Result provides an interface for all output means. It details the required contract that other portions of the Zeus XML data binding framework must use for processing to an arbitrary output.

This implementation of Result deals with output to Java I/O streams, such as OutputStreams and Writers. It allows passing in of these types of constructs and subsequent output to them, through various constructors.

Author:
Brett McLaughlin

Fields inherited from class org.enhydra.zeus.result.BaseResult
systemID
 
Constructor Summary
StreamResult(java.io.OutputStream outputStream)
           This will take in an OutputStream and output XML to that stream when asked It assumes that no system ID is present; for passing in a system ID, see StreamResult(OutputStream, String).
StreamResult(java.io.OutputStream outputStream, java.lang.String systemID)
           This will take in an OutputStream and output XML to that stream when asked.
StreamResult(java.io.Writer writer)
           This will take in a Writer and write XML to that stream when asked.
StreamResult(java.io.Writer writer, java.lang.String systemID)
           This will take in a Reader and write XML to that stream when asked.
 
Method Summary
 java.io.Writer getWriter()
           This will expose the Writer associated with this StreamResult for direct manipulation.
 void write(java.lang.String output)
           This will write a character stream to the output facility associated with this Result.
 
Methods inherited from class org.enhydra.zeus.result.BaseResult
getSystemID, setSystemID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamResult

public StreamResult(java.io.OutputStream outputStream,
                    java.lang.String systemID)

This will take in an OutputStream and output XML to that stream when asked. It also takes in a system ID for resolution of external references.

Parameters:
outputStream - OutputStream to write to.
systemID - String system ID for output document.

StreamResult

public StreamResult(java.io.OutputStream outputStream)

This will take in an OutputStream and output XML to that stream when asked It assumes that no system ID is present; for passing in a system ID, see StreamResult(OutputStream, String).

Parameters:
outputStream - OutputStream to write to.

StreamResult

public StreamResult(java.io.Writer writer,
                    java.lang.String systemID)

This will take in a Reader and write XML to that stream when asked. It also takes in a system ID for resolution of external references.

Parameters:
writer - Writer to write to.
systemID - String system ID for input document.

StreamResult

public StreamResult(java.io.Writer writer)

This will take in a Writer and write XML to that stream when asked. It assumes that no system ID is present; for passing in a system ID, see StreamResult(Writer, String).

Parameters:
reader - Writer to write to.
Method Detail

write

public void write(java.lang.String output)
           throws java.io.IOException

This will write a character stream to the output facility associated with this Result. No additional formatting is added, so line feeds, tabs, or other special characters should be handled by the code performing output.

Overrides:
write in class BaseResult
Parameters:
output - String to output.
Throws:
IOException - - when errors in output occur.

getWriter

public java.io.Writer getWriter()
                         throws java.io.IOException

This will expose the Writer associated with this StreamResult for direct manipulation.

Returns:
Writer - the output method for this Result.


Copyright © 2001 Enhydra. All Rights Reserved.