Package com.kheops.util
Class CSVExporter
java.lang.Object
com.kheops.util.CSVExporter
This class contains methods to create CSV formatted strings.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic char
getPreferredSeparator
(String language) Returns the commonly used list separator for the specified language.static int
toCSV
(String[] fields, Object[][] values, char separator, OutputStream stream) Deprecated.Use toCSV(String[], Object[][], Locale, OutputStream) insteadstatic int
toCSV
(String[] fields, Object[][] values, Locale locale, OutputStream stream) Writes CSV formatted data to the specified stream using the specified fields, values and using the specified separator character.static int
toCSV
(String[] fields, Object[][] values, Locale locale, String columnSeparator, OutputStream stream) Writes CSV formatted data to the specified stream using the specified fields, values and using the specified separator character.static int
toCSV
(TableModel model, char separator, boolean[] columnFilters, OutputStream stream) Deprecated.static int
toCSV
(TableModel model, char separator, OutputStream stream) Deprecated.static int
toCSV
(TableModel model, Locale locale, boolean[] columnFilters, OutputStream stream) Writes CSV formatted data to the specified stream using the specified table model and using the specified separator character.static int
toCSV
(TableModel model, Locale locale, OutputStream stream) Writes CSV formatted data to the specified stream using the specified table model and using the specified separator character.
-
Constructor Details
-
CSVExporter
public CSVExporter()
-
-
Method Details
-
toCSV
@Deprecated public static int toCSV(TableModel model, char separator, OutputStream stream) throws IOException Deprecated.Writes CSV formatted data to the specified stream using the specified table model and using the specified separator character.- Parameters:
stream
- the output stream to write to- Returns:
- the length of the data
- Throws:
IOException
- See Also:
-
toCSV
Writes CSV formatted data to the specified stream using the specified table model and using the specified separator character.- Parameters:
stream
- the output stream to write to- Returns:
- the length of the data
- Throws:
IOException
-
toCSV
@Deprecated public static int toCSV(TableModel model, char separator, boolean[] columnFilters, OutputStream stream) throws IOException Deprecated.Writes CSV formatted data to the specified stream using the specified table model and using the specified separator character. If specified column filters is not null, only the columns that have a corresponding value equal to "true" will be included in the CSV.- Parameters:
stream
- the output stream to write to- Returns:
- the length of the data
- Throws:
IOException
- See Also:
-
toCSV
public static int toCSV(TableModel model, Locale locale, boolean[] columnFilters, OutputStream stream) throws IOException Writes CSV formatted data to the specified stream using the specified table model and using the specified separator character. If specified column filters is not null, only the columns that have a corresponding value equal to "true" will be included in the CSV.- Parameters:
stream
- the output stream to write to- Returns:
- the length of the data
- Throws:
IOException
-
toCSV
@Deprecated public static int toCSV(String[] fields, Object[][] values, char separator, OutputStream stream) throws IOException Deprecated.Use toCSV(String[], Object[][], Locale, OutputStream) insteadWrites CSV formatted data to the specified stream using the specified fields, values and using the specified separator character. If specified column filters is not null, only the columns that have a corresponding value equal to "true" will be included in the CSV.- Parameters:
stream
- the output stream to write to- Returns:
- the length of the data
- Throws:
IOException
-
toCSV
public static int toCSV(String[] fields, Object[][] values, Locale locale, OutputStream stream) throws IOException Writes CSV formatted data to the specified stream using the specified fields, values and using the specified separator character. If specified column filters is not null, only the columns that have a corresponding value equal to "true" will be included in the CSV.- Parameters:
stream
- the output stream to write to- Returns:
- the length of the data
- Throws:
IOException
-
toCSV
public static int toCSV(String[] fields, Object[][] values, Locale locale, String columnSeparator, OutputStream stream) throws IOException Writes CSV formatted data to the specified stream using the specified fields, values and using the specified separator character. If specified column filters is not null, only the columns that have a corresponding value equal to "true" will be included in the CSV.- Parameters:
stream
- the output stream to write to- Returns:
- the length of the data
- Throws:
IOException
-
getPreferredSeparator
Returns the commonly used list separator for the specified language.- Parameters:
language
- the language- Returns:
- the preferred separator character
-