|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sibvisions.rad.model.DataBookCSVExporter
public final class DataBookCSVExporter
The DataBookUtil
handles simple access to databooks. It allows export/import of
data.
Method Summary | |
---|---|
static java.lang.String |
formatCSVFileName(java.lang.String pName)
Formats a name as filename for a csv export. |
static java.lang.String |
getDefaultEncoding()
Get the default encoding for CSV exports. |
static void |
setDefaultEncoding(java.lang.String pEncoding)
Sets the default encoding for CSV exports. |
static void |
writeCSV(IDataBook pBook,
java.io.OutputStream pStream)
Writes all rows and values of a databook, as comma separated values to a stream. |
static void |
writeCSV(IDataBook pBook,
java.io.OutputStream pStream,
java.lang.String pEncoding)
Writes all rows and values of a databook, as comma separated values to a stream. |
static void |
writeCSV(IDataBook pBook,
java.io.OutputStream pStream,
java.lang.String[] pColumnNames,
java.lang.String[] pLabels,
ICondition pFilter,
SortDefinition pSort)
Writes all rows and values of a databook, as comma separated values to a stream. |
static void |
writeCSV(IDataBook pBook,
java.io.OutputStream pStream,
java.lang.String[] pColumnNames,
java.lang.String[] pLabels,
ICondition pFilter,
SortDefinition pSort,
java.lang.String pSeparator)
Writes all rows and values of a databook, as comma separated values to a stream. |
static void |
writeCSV(IDataBook pBook,
java.io.OutputStream pStream,
java.lang.String[] pColumnNames,
java.lang.String[] pLabels,
ICondition pFilter,
SortDefinition pSort,
java.lang.String pSeparator,
java.lang.String pEncoding)
Writes all rows and values of a databook, as comma separated values to a stream. |
static void |
writeQuoted(java.io.OutputStreamWriter pStream,
IDataType pDataType,
java.lang.Object pValue,
java.lang.String pSeparator)
Writes an object as quoted string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void writeCSV(IDataBook pBook, java.io.OutputStream pStream) throws ModelException, java.io.IOException
pBook
- the databookpStream
- the output stream
ModelException
- if the access to rows or values of the databook fails
java.io.IOException
- if an error occurs during writingpublic static void writeCSV(IDataBook pBook, java.io.OutputStream pStream, java.lang.String pEncoding) throws ModelException, java.io.IOException
pBook
- the databookpStream
- the output streampEncoding
- the character encoding
ModelException
- if the access to rows or values of the databook fails
java.io.IOException
- if an error occurs during writingpublic static void writeCSV(IDataBook pBook, java.io.OutputStream pStream, java.lang.String[] pColumnNames, java.lang.String[] pLabels, ICondition pFilter, SortDefinition pSort) throws ModelException, java.io.IOException
pBook
- the databookpStream
- the output streampColumnNames
- specific column names or null
to use the
column names from the current ColumnView
pLabels
- the preferred column labelspFilter
- the export filterpSort
- the export sort definition
ModelException
- if the access to rows or values of the databook fails
java.io.IOException
- if an error occurs during writingpublic static void writeCSV(IDataBook pBook, java.io.OutputStream pStream, java.lang.String[] pColumnNames, java.lang.String[] pLabels, ICondition pFilter, SortDefinition pSort, java.lang.String pSeparator) throws ModelException, java.io.IOException
pBook
- the databookpStream
- the output streampColumnNames
- specific column names or null
to use the column names
from the current ColumnView
pLabels
- the preferred column labelspFilter
- the export filterpSort
- the export sort definitionpSeparator
- the list separator
ModelException
- if the access to rows or values of the databook fails
java.io.IOException
- if an error occurs during writingpublic static void writeCSV(IDataBook pBook, java.io.OutputStream pStream, java.lang.String[] pColumnNames, java.lang.String[] pLabels, ICondition pFilter, SortDefinition pSort, java.lang.String pSeparator, java.lang.String pEncoding) throws ModelException, java.io.IOException
pBook
- the databookpStream
- the output streampColumnNames
- specific column names or null
to use the column names
from the current ColumnView
pLabels
- the preferred column labelspFilter
- the export filterpSort
- the export sort definitionpSeparator
- the list separatorpEncoding
- the character encoding
ModelException
- if the access to rows or values of the databook fails
java.io.IOException
- if an error occurs during writingpublic static java.lang.String formatCSVFileName(java.lang.String pName)
pName
- a databook name or filename. Predefined extensions will be re-used.
pName
is null
then
Export.csv
is used.public static void writeQuoted(java.io.OutputStreamWriter pStream, IDataType pDataType, java.lang.Object pValue, java.lang.String pSeparator) throws java.io.IOException
pStream
- the output streampDataType
- the datatype for the given valuepValue
- the valuepSeparator
- the column separator
java.io.IOException
- if a write error occurspublic static void setDefaultEncoding(java.lang.String pEncoding)
pEncoding
- the encodingpublic static java.lang.String getDefaultEncoding()
Charset.defaultCharset()
acts as fallback.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |