|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.c24.io.api.presentation.stream.SpreadSheet
biz.c24.io.api.presentation.stream.SpreadSheetWriter
public class SpreadSheetWriter
SpreadSheet broker implementation for writing.
Represents the functional part for writing the bounded object tree back to the SpreadSheet. (Provides the inverse forSpreadSheet reader broker
.) Additionally to the
generic SpreadSheet broker
it provides the variety methods for
writing the values with respect of their type definitions:
writing the textual data
,writing the numeric data
,writing the date data
,writing the boolean data
,(pseudo) writing the empty data
.sheet resolution procedure
creates the sheet "on the fly" if it is not
exists. For more details please see the corresponding description.
SpreadSheet
,
SpreadSheetReader
Nested Class Summary |
---|
Nested classes/interfaces inherited from class biz.c24.io.api.presentation.stream.SpreadSheet |
---|
SpreadSheet.Locator |
Field Summary | |
---|---|
static int |
FORMAT_BIFF
The BIFF8 format (Office '97) ID. |
static int |
FORMAT_OOXML
The OOXML format (from Office 2002) ID. |
Fields inherited from class biz.c24.io.api.presentation.stream.SpreadSheet |
---|
ditches, location, workbook |
Constructor Summary | |
---|---|
|
SpreadSheetWriter(int format)
Constructor with format ID. |
protected |
SpreadSheetWriter(org.apache.poi.ss.usermodel.Workbook workbook)
Constructor with 3rd party workbook instance. |
Method Summary | |
---|---|
protected org.apache.poi.ss.usermodel.Cell |
getCellAt(SpreadSheet.Locator position)
Returns the SpreadSheet cell at specified address. |
protected int |
resolveSheet(String name)
Returns the sheet index in workbook used. |
void |
write(OutputStream stream)
Sinks the used workbook into output stream. |
void |
writeBooleanValue(boolean value)
Writes the boolean data in current cell. |
void |
writeDateValue(Date value)
Writes the date data in current cell. |
void |
writeNullValue()
Marks the current cell as empty. |
void |
writeNumericValue(double value)
Writes the numeric data in current cell. |
void |
writeStringValue(String value)
Writes the textual data in current cell. |
Methods inherited from class biz.c24.io.api.presentation.stream.SpreadSheet |
---|
calculateNext, getDitch, getLocation, getSheetName, mark, next, occupy, parse, rollback, setStartLocation, withdraw |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int FORMAT_BIFF
public static int FORMAT_OOXML
Constructor Detail |
---|
public SpreadSheetWriter(int format)
format
- The workbook instance that will be used.protected SpreadSheetWriter(org.apache.poi.ss.usermodel.Workbook workbook)
workbook
.
workbook
- The workbook
implementation that will be used.Method Detail |
---|
public void writeStringValue(String value)
value
- The text that need to be written.public void writeNumericValue(double value)
value
- The number that need to be written.public void writeDateValue(Date value)
value
- The date that need to be written.public void writeBooleanValue(boolean value)
value
- The boolean value that need to be written.public void writeNullValue()
public void write(OutputStream stream) throws IOException
workbook
into provided stream
. Client is responsible for resource releasing (stream flush/close).
stream
- The output stream for writing the workbook.
IOException
- If I/O error happened.protected org.apache.poi.ss.usermodel.Cell getCellAt(SpreadSheet.Locator position)
SpreadSheet cell
at requested
location
. If sheet, row or cell is not exist, they
will be created.
position
- The location (i.e. address) of requested cell.
protected int resolveSheet(String name)
name
is null
the current existing
sheet index is returned. If requested sheet is not exists, it will be created "on the fly".
resolveSheet
in class SpreadSheet
name
- The requested sheet name, may be null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |