|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.grid.CsvTableUtils
public class CsvTableUtils
CsvTableUtils
is a class that has methods to export any JTable's content to Character Separated Values
file format.
Nested Class Summary | |
---|---|
static class |
CsvTableUtils.CsvTableExportConfig
A class that has all the parameters that could be customized when exporting a table or a TableScrollPane to csv file. |
Constructor Summary | |
---|---|
CsvTableUtils()
|
Method Summary | |
---|---|
static void |
addCellValue(StringBuffer csvBuffer,
String cellValue,
char separator)
|
static void |
addLineBreak(StringBuffer csvBuffer)
|
static boolean |
export(JTable table,
int firstRow,
int firstColumn,
int numberOfRows,
int numberOfColumns,
String fileName,
boolean includeTableHeader,
ValueConverter cellValueConverter,
StringConverter columnNameConverter)
Exports the table to an CSV file. |
static boolean |
export(JTable table,
int firstRow,
int firstColumn,
int numberOfRows,
int numberOfColumns,
String fileName,
boolean includeTableHeader,
ValueConverter cellValueConverter,
StringConverter columnNameConverter,
char separator)
Exports the table to an CSV file. |
static boolean |
export(JTable table,
OutputStream out)
Exports the table to a CSV file output steam. |
static boolean |
export(JTable table,
OutputStream out,
boolean includeTableHeader)
Exports the table to a CSV file output steam. |
static boolean |
export(JTable table,
OutputStream out,
boolean includeTableHeader,
ValueConverter cellValueConverter)
Exports the table to a CSV file output steam. |
static boolean |
export(JTable table,
OutputStream out,
boolean includeTableHeader,
ValueConverter cellValueConverter,
StringConverter columnNameConverter)
Exports the table to a CSV file output steam. |
static boolean |
export(JTable table,
OutputStream out,
CsvTableUtils.CsvTableExportConfig config)
Exports the table to a CSV file output steam. |
static boolean |
export(JTable table,
OutputStream out,
int firstRow,
int firstColumn,
int numberOfRows,
int numberOfColumns,
boolean includeTableHeader,
ValueConverter cellValueConverter,
StringConverter columnNameConverter)
Exports the table to a CSV file output steam. |
static boolean |
export(JTable table,
OutputStream out,
int firstRow,
int firstColumn,
int numberOfRows,
int numberOfColumns,
boolean includeTableHeader,
ValueConverter cellValueConverter,
StringConverter columnNameConverter,
char separator)
Exports the table to a CSV file output steam. |
static boolean |
export(JTable table,
String fileName)
Exports the table to an CSV file. |
static boolean |
export(JTable table,
String fileName,
boolean includeTableHeader)
Exports the table to an CSV file. |
static boolean |
export(JTable table,
String fileName,
boolean includeTableHeader,
ValueConverter cellValueConverter)
Exports the table to an CSV file. |
static boolean |
export(JTable table,
String fileName,
boolean includeTableHeader,
ValueConverter cellValueConverter,
StringConverter columnNameConverter)
Exports the table to an CSV file. |
static boolean |
export(JTable table,
String fileName,
CsvTableUtils.CsvTableExportConfig config)
Exports the table to an CSV file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CsvTableUtils()
Method Detail |
---|
public static boolean export(JTable table, String fileName) throws IOException
table
- the table to be exported.fileName
- the CSV file name. It should be the full path to the file.
IOException
- if the write to the file failed.
FileNotFoundException
- if the file exists but is a directory rather than a regular file, does not
exist but cannot be created, or cannot be opened for any other reasonpublic static boolean export(JTable table, String fileName, boolean includeTableHeader) throws IOException
table
- the table to be exported.fileName
- the CSV file name. It should be the full path to the file.includeTableHeader
- whether to include the table header.
IOException
- if the write to the file failed.
FileNotFoundException
- if the file exists but is a directory rather than a regular file, does not
exist but cannot be created, or cannot be opened for any other reasonpublic static boolean export(JTable table, String fileName, boolean includeTableHeader, ValueConverter cellValueConverter) throws IOException
table
- the table to be exported.fileName
- the CSV file name. It should be the full path to the file.includeTableHeader
- whether to include the table header.cellValueConverter
- the converter to convert cell value to the value that can be set to CSV cell.
IOException
- if the write to the file failed.
FileNotFoundException
- if the file exists but is a directory rather than a regular file, does not
exist but cannot be created, or cannot be opened for any other reasonpublic static boolean export(JTable table, String fileName, boolean includeTableHeader, ValueConverter cellValueConverter, StringConverter columnNameConverter) throws IOException
table
- the table to be exported.fileName
- the CSV file name. It should be the full path to the file.includeTableHeader
- whether to include the table header.cellValueConverter
- the converter to convert cell value to the value that can be set to CSV cell.columnNameConverter
- the converter to convert the column name.
IOException
- if the write to the file failed.
FileNotFoundException
- if the file exists but is a directory rather than a regular file, does not
exist but cannot be created, or cannot be opened for any other reasonpublic static boolean export(JTable table, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, String fileName, boolean includeTableHeader, ValueConverter cellValueConverter, StringConverter columnNameConverter) throws IOException
table
- the table to be exported.firstRow
- the first row to be exportedfirstColumn
- the first row to be exportednumberOfRows
- number of rows to be exported, -1 means all rows.numberOfColumns
- number of columns to be exported. -1 means all columns.fileName
- the CSV file name. It should be the full path to the file.includeTableHeader
- whether to include the table header.cellValueConverter
- the converter to convert cell value to the value that can be set to CSV cell.columnNameConverter
- the converter to convert the column name.
IOException
- if the write to the file failed.
FileNotFoundException
- if the file exists but is a directory rather than a regular file, does not
exist but cannot be created, or cannot be opened for any other reasonpublic static boolean export(JTable table, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, String fileName, boolean includeTableHeader, ValueConverter cellValueConverter, StringConverter columnNameConverter, char separator) throws IOException
table
- the table to be exported.firstRow
- the first row to be exportedfirstColumn
- the first row to be exportednumberOfRows
- number of rows to be exported, -1 means all rows.numberOfColumns
- number of columns to be exported. -1 means all columns.fileName
- the CSV file name. It should be the full path to the file.includeTableHeader
- whether to include the table header.cellValueConverter
- the converter to convert cell value to the value that can be set to CSV cell.columnNameConverter
- the converter to convert the column name.separator
- the character used to separate the cells. By default, it is a comma.
IOException
- if the write to the file failed.
FileNotFoundException
- if the file exists but is a directory rather than a regular file, does not
exist but cannot be created, or cannot be opened for any other reasonpublic static boolean export(JTable table, String fileName, CsvTableUtils.CsvTableExportConfig config) throws IOException
table
- the table to be exported.fileName
- the CSV file name. It should be the full path to the file.config
- a collection of the parameters that could be configured during the export process.
IOException
- if the write to the file failed.
FileNotFoundException
- if the file exists but is a directory rather than a regular file, does not
exist but cannot be created, or cannot be opened for any other reasonpublic static void addCellValue(StringBuffer csvBuffer, String cellValue, char separator)
public static void addLineBreak(StringBuffer csvBuffer)
public static boolean export(JTable table, OutputStream out) throws IOException
table
- the table to be exported.out
- the output stream
IOException
- if the write to the file failed.
FileNotFoundException
- if the file exists but is a directory rather than a regular file, does not
exist but cannot be created, or cannot be opened for any other reasonpublic static boolean export(JTable table, OutputStream out, boolean includeTableHeader) throws IOException
table
- the table to be exported.out
- the output streamincludeTableHeader
- whether to include the table header.
IOException
- if the write to the file failed.
FileNotFoundException
- if the file exists but is a directory rather than a regular file, does not
exist but cannot be created, or cannot be opened for any other reasonpublic static boolean export(JTable table, OutputStream out, boolean includeTableHeader, ValueConverter cellValueConverter) throws IOException
table
- the table to be exported.out
- the output streamincludeTableHeader
- whether to include the table header.cellValueConverter
- the converter to convert cell value to the value that can be set to CSV cell.
IOException
- if the write to the file failed.
FileNotFoundException
- if the file exists but is a directory rather than a regular file, does not
exist but cannot be created, or cannot be opened for any other reasonpublic static boolean export(JTable table, OutputStream out, boolean includeTableHeader, ValueConverter cellValueConverter, StringConverter columnNameConverter) throws IOException
table
- the table to be exported.out
- the output streamincludeTableHeader
- whether to include the table header.cellValueConverter
- the converter to convert cell value to the value that can be set to CSV cell.columnNameConverter
- the converter to convert the column name.
IOException
- if the write to the file failed.
FileNotFoundException
- if the file exists but is a directory rather than a regular file, does not
exist but cannot be created, or cannot be opened for any other reasonpublic static boolean export(JTable table, OutputStream out, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, boolean includeTableHeader, ValueConverter cellValueConverter, StringConverter columnNameConverter) throws IOException
table
- the table to be exported.out
- the output streamfirstRow
- the first row to be exportedfirstColumn
- the first row to be exportednumberOfRows
- number of rows to be exported, -1 means all rows.numberOfColumns
- number of columns to be exported. -1 means all columns.includeTableHeader
- whether to include the table header.cellValueConverter
- the converter to convert cell value to the value that can be set to CSV cell.columnNameConverter
- the converter to convert the column name.
IOException
- if the write to the file failed.
FileNotFoundException
- if the file exists but is a directory rather than a regular file, does not
exist but cannot be created, or cannot be opened for any other reasonpublic static boolean export(JTable table, OutputStream out, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, boolean includeTableHeader, ValueConverter cellValueConverter, StringConverter columnNameConverter, char separator) throws IOException
table
- the table to be exported.out
- the output streamfirstRow
- the first row to be exportedfirstColumn
- the first row to be exportednumberOfRows
- number of rows to be exported, -1 means all rows.numberOfColumns
- number of columns to be exported. -1 means all columns.includeTableHeader
- whether to include the table header.cellValueConverter
- the converter to convert cell value to the value that can be set to CSV cell.columnNameConverter
- the converter to convert the column name.separator
- the character used to separate the cells. By default, it is a comma.
IOException
- if the write to the file failed.
FileNotFoundException
- if the file exists but is a directory rather than a regular file, does not
exist but cannot be created, or cannot be opened for any other reasonpublic static boolean export(JTable table, OutputStream out, CsvTableUtils.CsvTableExportConfig config) throws IOException
table
- the table to be exported.out
- the output streamconfig
- a collection of the parameters that could be configured during the export process.
IOException
- if the write to the file failed.
FileNotFoundException
- if the file exists but is a directory rather than a regular file, does not
exist but cannot be created, or cannot be opened for any other reason
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |