Class CSVExporter

java.lang.Object
com.kheops.util.CSVExporter

public class CSVExporter extends Object
This class contains methods to create CSV formatted strings.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static char
    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) instead
    static 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public static int toCSV(TableModel model, Locale locale, OutputStream stream) throws IOException
      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) instead
      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, 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

      public static char getPreferredSeparator(String language)
      Returns the commonly used list separator for the specified language.
      Parameters:
      language - the language
      Returns:
      the preferred separator character