biz.c24.io.api.presentation
Class InterchangeSink

java.lang.Object
  extended by biz.c24.io.api.presentation.Sink
      extended by biz.c24.io.api.presentation.InterchangeSink
All Implemented Interfaces:
Serializable, Cloneable

public class InterchangeSink
extends Sink

A sink for generating interchange template copies from data objects.

Note that this implementation is not synchronized. If multiple threads use an instance concurrently, it must be synchronized externally.

See Also:
Sink, Serialized Form

Constructor Summary
InterchangeSink()
          Constructs a new instance.
InterchangeSink(InterchangeSink clone)
          Constructs a new instance cloned from clone.
InterchangeSink(OutputStream stream)
          Constructs a new instance which will write to stream.
InterchangeSink(Writer writer)
          Constructs a new instance which will write to writer.
 
Method Summary
 Object clone()
           
 String getContent()
          Returns the content of the template.
 void readContent(Reader reader)
          Reads the content from the supplied reader.
 void setContent(String content)
          Sets the content of the template.
 void writeObject(ComplexDataObject obj)
          Writes an object to the writer or output stream that has been set.
 
Methods inherited from class biz.c24.io.api.presentation.Sink
checkInit, clearBatchIterators, getEncoding, getOutputStream, getWriter, registerBatchIterator, setEncoding, setOutputStream, setWriter, stream, unregisterBatchIterator, writer
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InterchangeSink

public InterchangeSink()
Constructs a new instance.


InterchangeSink

public InterchangeSink(InterchangeSink clone)
Constructs a new instance cloned from clone.

Parameters:
clone - The instance to clone.

InterchangeSink

public InterchangeSink(OutputStream stream)
Constructs a new instance which will write to stream.

Parameters:
stream - The stream to write the data to.

InterchangeSink

public InterchangeSink(Writer writer)
Constructs a new instance which will write to writer.

Parameters:
writer - The writer to write the data to.
Method Detail

getContent

public String getContent()
Returns the content of the template.

Returns:
The templates content.

setContent

public void setContent(String content)
Sets the content of the template.

Parameters:
content - The templates content.

readContent

public void readContent(Reader reader)
                 throws IOException
Reads the content from the supplied reader.

Parameters:
reader - The reader from which the content should be read.
Throws:
IOException - If there is an error reading from reader.

writeObject

public void writeObject(ComplexDataObject obj)
                 throws IOException
Description copied from class: Sink
Writes an object to the writer or output stream that has been set.

Specified by:
writeObject in class Sink
Parameters:
obj - The object to be written.
Throws:
IOException - If the complete object could not be written for any reason.

clone

public Object clone()
Specified by:
clone in class Sink


C24 Technologies © 2002-2012: All Rights Reserved.