|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectolg.csv.base.AbstractSheetWriter
olg.csv.base.ods.ODSWriter
public class ODSWriter
ODS Writer based on ODFDOM API.
Nested Class Summary | |
---|---|
static class |
ODSWriter.ODSParser
This parser returns lines extracted from a string by interpreting \r, \n or \r\n as line breaks found in it. |
Field Summary |
---|
Fields inherited from class olg.csv.base.AbstractSheetWriter |
---|
beginAtColumn, beginAtRow, sheetName, withHeaders |
Constructor Summary | |
---|---|
ODSWriter(File outFile,
ODSSettings settings)
|
|
ODSWriter(OutputStream out,
ODSSettings settings)
Constructs ODSWriter with outputStream and Settings. |
Method Summary | |
---|---|
void |
addLine(String[] values)
Adds a row from the given String array. |
void |
addRow(Row row)
Adds a row. |
void |
close()
Close this stream and save the ODS Document to the file/stream and catch and log Exception if necessary. if the parent stream is provided and passed to its constructor by user, user must close it (close what you open!). |
Methods inherited from class olg.csv.base.AbstractSheetWriter |
---|
getSheetName, isWithHeaders |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ODSWriter(File outFile, ODSSettings settings) throws IOException
outFile
- if outFile exists and contains sheet with specified sheetName,
rewrites rows and cells in it. if sheetname sheet doesn't
exists, creates it and writes on it. If outFile not exists,
creates a new ODS File.settings
- the ODS Settings
IOException
- if an errors occurs on file opening.public ODSWriter(OutputStream out, ODSSettings settings) throws IOException
out
- writes a new ODSDocument on it.settings
- ODS Settings
IOException
- if unable to create a new ODS DocumentMethod Detail |
---|
public void close()
public void addRow(Row row)
The first row allows to define the size used along writing unless
IWriter.addLine(String[])
had been used first.
Throws a WriterException when row size differs from initial size or row num is lesser than the expected next number line. Or if I/O error occurs during writing.
row
- the row. It's possible to use a row with no cells. In this
case, an empty line(a line wich all fields are null) is added.
It's possible to use a row with a num greater than the
expected number. In this case, empty lines are wroten as much
as necessary. It's possible to use row which all cells are not
specified. In this case the missing cells are added as empty
cells. Must be not null with cells correctly ordered and
size>0.public void addLine(String[] values)
IWriter.addRow(Row)
had been used first.
Throws a WriterException when line size differs from initial size.
values
- the row. Must be not null
with length >0. .
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |