biz.c24.io.api.presentation
Class SSSource

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

public class SSSource
extends Source

Data reader implementation for a SpreadSheet workbook.

Provides facility for reading data object tree from SpreadSheet workbook.

Version:
$Revision: 18046 $ $Date: 2011-10-18 12:25:10 -0400 (Tue, 18 Oct 2011) $
See Also:
SSSink, Source, SpreadSheetReader, biz.c24.io.api.presentation.stream, Serialized Form

Constructor Summary
SSSource()
          Default constructor.
SSSource(InputStream stream)
          Constructor with intput stream.
SSSource(Source other)
          Constructor with another SpreadSheet reader instance.
 
Method Summary
 Object clone()
          Returns clone of this data reader.
 String getStartLocation()
          Returns the start location.
 void readObject(ComplexDataObject object)
          Reads an object from the the reader or input stream that has been set (optional operation).
 ComplexDataObject readObject(Element element)
          Reads an object from the the reader or input stream that has been set.
 void setReader(Reader reader)
          Sets the reader (optional operation).
 void setStartLocation(String start)
          Sets the start location.
 
Methods inherited from class biz.c24.io.api.presentation.Source
checkInit, getEncoding, getInputStream, getMarkableInputStream, getParseListener, getReader, getSystemId, reader, ready, setEncoding, setInputStream, setInputStream, setParseListener, setReader, setSystemId, stream
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SSSource

public SSSource()
Default constructor.

Constructs a new instance with default settings.


SSSource

public SSSource(Source other)
Constructor with another SpreadSheet reader instance.

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

Parameters:
other - The instance to clone.

SSSource

public SSSource(InputStream stream)
Constructor with intput stream.

Constructs a new instance which will read SpreadSheet from stream. The format will be detected automatically. In case if data format is not supported the corresponding exception will throw.

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.

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

setReader

public void setReader(Reader reader)
Sets the reader (optional operation).

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

Overrides:
setReader in class Source
Parameters:
reader - The new value.
Throws:
UnsupportedOperationException - If this source does not support input from a java.io.Reader, in which case a java.io.InputStream should be used.

readObject

public void readObject(ComplexDataObject object)
                throws IOException
Reads an object from the the reader or input stream that has been set (optional operation).

Is not implemented and throw exception.

Specified by:
readObject in class Source
Parameters:
object - The object into which the input data should be parsed.
Throws:
IOException - If the complete object could not be read for any reason.
IllegalArgumentException - If neither a reader nor an input stream has been set.
UnsupportedOperationException - If this source does not support this method, in which case readObject(Element) should be used.

readObject

public ComplexDataObject readObject(Element element)
                             throws IOException
Reads an object from the the reader or input stream that has been set.

Returns the data object tree that is bound to the SpreadSheet previously specified by incoming data stream.

Specified by:
readObject in class Source
Parameters:
element - The element declaration to which the input data is expected to adhere.
Returns:
The newly created object.
Throws:
IOException - If the complete object could not be read for any reason.
IllegalArgumentException - If neither a reader nor an input stream has been set.

clone

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

Specified by:
clone in class Source
Returns:
The cloned SpreadSheet writer with the same start location.
See Also:
SSSource(Source)


C24 Technologies © 2002-2012: All Rights Reserved.