biz.c24.io.api.presentation
Class SSSink

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

public class SSSink
extends Sink

Data writer implementation for a SpreadSheet workbook.

Provides facility for serialization data object tree into SpreadSheet workbook.

Version:
$Revision: 18541 $ $Date: 2012-03-09 10:51:50 -0500 (Fri, 09 Mar 2012) $
See Also:
SSSource, Sink, SpreadSheetWriter, biz.c24.io.api.presentation.stream, Serialized Form

Constructor Summary
SSSink()
          Default constructor.
SSSink(OutputStream stream)
          Constructor with output stream.
SSSink(SSSink other)
          Constructor with another SpreadSheet writer instance.
 
Method Summary
 Object clone()
          Returns clone of this data writer.
 int getFormat()
          Returns the result SpreadSheet format.
 String getStartLocation()
          Returns the start location.
 void setFormat(int format)
          Sets the result SpreadSheet format.
 void setStartLocation(String start)
          Sets the start location.
 void setWriter(Writer writer)
          Sets the writer (optional operation).
 void writeObject(ComplexDataObject obj)
          Writes an object to the writer or output stream that has been set previously.
 
Methods inherited from class biz.c24.io.api.presentation.Sink
checkInit, clearBatchIterators, getEncoding, getOutputStream, getWriter, registerBatchIterator, setEncoding, setOutputStream, stream, unregisterBatchIterator, writer
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SSSink

public SSSink()
Default constructor.

Constructs a new instance with default settings.


SSSink

public SSSink(SSSink other)
Constructor with another SpreadSheet writer instance.

Constructs a new instance cloned from clone. Cloning procedure the same as standard cloning method

Parameters:
other - The instance to clone.

SSSink

public SSSink(OutputStream stream)
Constructor with output stream.

Constructs a new instance which will write to stream.

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

getStartLocation

public String getStartLocation()
Returns the start location.

Start location will force writer to start the process from specified point.

Returns:
The start location as R1C1 address. By default it is assumed R0C0.

setStartLocation

public void setStartLocation(String start)
Sets the start location.

Specified location should comply to the R1C1 address format.

Parameters:
start - The start location.
See Also:
getStartLocation()

getFormat

public int getFormat()
Returns the result SpreadSheet format.

Returns the SpreadSheet format identifier. One from supported. By default it is assumed BIFF.

Returns:
The format identifier.

setFormat

public void setFormat(int format)
Sets the result SpreadSheet format.

Parameters:
format - The format identifier, one from supported.
See Also:
getFormat()

setWriter

public void setWriter(Writer writer)
Sets the writer (optional operation).

Always throw the exception because this implementation could not use the writer.

Overrides:
setWriter in class Sink
Parameters:
writer - The new value.
Throws:
UnsupportedOperationException - If this source does not support output to a java.io.Writer, in which case a java.io.OutputStream should be used.

clone

public Object clone()
Returns clone of this data writer.

Specified by:
clone in class Sink
Returns:
The cloned SpreadSheet writer with the same format and start location.
See Also:
SSSink(SSSink)

writeObject

public void writeObject(ComplexDataObject obj)
                 throws IOException
Writes an object to the writer or output stream that has been set previously.

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.
IllegalArgumentException - If neither a writer nor an output stream has been set.


C24 Technologies © 2002-2012: All Rights Reserved.