com.tibbo.aggregate.common.util

## Class CsvImportExportUtils

- java.lang.Object
- - com.tibbo.aggregate.common.util.CsvImportExportUtils

-     public class CsvImportExportUtils
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `CSV_EXPORT_FIELD_DELIMITER`
    `static java.lang.String` | `CSV_EXPORT_FIELD_ESCAPE_MODE`
    `static java.lang.String` | `CSV_EXPORT_FIELD_HEADER`
    `static java.lang.String` | `CSV_EXPORT_FIELD_QUALIFIER`
    `static java.lang.String` | `CSV_EXPORT_FIELD_USE_DESCRIPTIONS`
    `static java.lang.String` | `CSV_EXPORT_FIELD_USE_QUALIFIER`
    `static TableFormat` | `CSV_EXPORT_FORMAT`
    `static java.lang.String` | `CSV_IMPORT_FIELD_COMMENT`
    `static java.lang.String` | `CSV_IMPORT_FIELD_DELIMITER`
    `static java.lang.String` | `CSV_IMPORT_FIELD_ESCAPE_MODE`
    `static java.lang.String` | `CSV_IMPORT_FIELD_HEADER`
    `static java.lang.String` | `CSV_IMPORT_FIELD_QUALIFIER`
    `static java.lang.String` | `CSV_IMPORT_FIELD_USE_QUALIFIER`
    `static TableFormat` | `CSV_IMPORT_FORMAT`
    `static int` | `HEADER_DESCRIPTIONS`
    `static int` | `HEADER_NAMES`
    `static int` | `HEADER_NONE`
    `static int` | `HEADER_SKIP`
    `static int` | `QUALIFIER_FORCE`
    `static int` | `QUALIFIER_NONE`
    `static int` | `QUALIFIER_NORMAL`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static com.csvreader.CsvReader` | `createCsvReader(byte[] data, char delimiter, boolean useQualifier, char qualifier, int escapeMode, boolean useComments, char comment)`
    `static com.csvreader.CsvReader` | `createCsvReader(byte[] data, DataTable options)`
    `static boolean` | `fillEmptyHeaders(com.csvreader.CsvReader reader)` Replaces all null or empty headers in `reader` by the string representation of the corresponding column number.
    `static void` | `readCsvRecords(DataTable table, com.csvreader.CsvReader reader, int header, boolean hasMoreRecords)`
    `static TableFormat` | `readFormat(DataTable original, com.csvreader.CsvReader reader, int header)` Note: in case if `original` is null and `header` is `HEADER_NAMES`, any null or empty headers in `reader` will be replaced by the string representation of the corresponding column number.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### CSV_IMPORT_FIELD_DELIMITER

          public static final java.lang.String CSV_IMPORT_FIELD_DELIMITER

      See Also:
        Constant Field Values

    - #### CSV_IMPORT_FIELD_USE_QUALIFIER

          public static final java.lang.String CSV_IMPORT_FIELD_USE_QUALIFIER

      See Also:
        Constant Field Values

    - #### CSV_IMPORT_FIELD_QUALIFIER

          public static final java.lang.String CSV_IMPORT_FIELD_QUALIFIER

      See Also:
        Constant Field Values

    - #### CSV_IMPORT_FIELD_COMMENT

          public static final java.lang.String CSV_IMPORT_FIELD_COMMENT

      See Also:
        Constant Field Values

    - #### CSV_IMPORT_FIELD_ESCAPE_MODE

          public static final java.lang.String CSV_IMPORT_FIELD_ESCAPE_MODE

      See Also:
        Constant Field Values

    - #### CSV_IMPORT_FIELD_HEADER

          public static final java.lang.String CSV_IMPORT_FIELD_HEADER

      See Also:
        Constant Field Values

    - #### CSV_EXPORT_FIELD_DELIMITER

          public static final java.lang.String CSV_EXPORT_FIELD_DELIMITER

      See Also:
        Constant Field Values

    - #### CSV_EXPORT_FIELD_USE_QUALIFIER

          public static final java.lang.String CSV_EXPORT_FIELD_USE_QUALIFIER

      See Also:
        Constant Field Values

    - #### CSV_EXPORT_FIELD_QUALIFIER

          public static final java.lang.String CSV_EXPORT_FIELD_QUALIFIER

      See Also:
        Constant Field Values

    - #### CSV_EXPORT_FIELD_ESCAPE_MODE

          public static final java.lang.String CSV_EXPORT_FIELD_ESCAPE_MODE

      See Also:
        Constant Field Values

    - #### CSV_EXPORT_FIELD_HEADER

          public static final java.lang.String CSV_EXPORT_FIELD_HEADER

      See Also:
        Constant Field Values

    - #### CSV_EXPORT_FIELD_USE_DESCRIPTIONS

          public static final java.lang.String CSV_EXPORT_FIELD_USE_DESCRIPTIONS

      See Also:
        Constant Field Values

    - #### QUALIFIER_NONE

          public static final int QUALIFIER_NONE

      See Also:
        Constant Field Values

    - #### QUALIFIER_NORMAL

          public static final int QUALIFIER_NORMAL

      See Also:
        Constant Field Values

    - #### QUALIFIER_FORCE

          public static final int QUALIFIER_FORCE

      See Also:
        Constant Field Values

    - #### HEADER_NONE

          public static final int HEADER_NONE

      See Also:
        Constant Field Values

    - #### HEADER_NAMES

          public static final int HEADER_NAMES

      See Also:
        Constant Field Values

    - #### HEADER_DESCRIPTIONS

          public static final int HEADER_DESCRIPTIONS

      See Also:
        Constant Field Values

    - #### HEADER_SKIP

          public static final int HEADER_SKIP

      See Also:
        Constant Field Values

    - #### CSV_EXPORT_FORMAT

          public static TableFormat CSV_EXPORT_FORMAT

    - #### CSV_IMPORT_FORMAT

          public static TableFormat CSV_IMPORT_FORMAT

  - ### Method Detail

    - #### readCsvRecords

          public static void readCsvRecords(DataTable table,
                                            com.csvreader.CsvReader reader,
                                            int header,
                                            boolean hasMoreRecords)
                                     throws AggreGateException,
                                            java.io.IOException

      Throws:
        `AggreGateException`
        `java.io.IOException`

    - #### createCsvReader

          public static com.csvreader.CsvReader createCsvReader(byte[] data,
                                                                char delimiter,
                                                                boolean useQualifier,
                                                                char qualifier,
                                                                int escapeMode,
                                                                boolean useComments,
                                                                char comment)

    - #### createCsvReader

          public static com.csvreader.CsvReader createCsvReader(byte[] data,
                                                                DataTable options)

    - #### readFormat

          public static TableFormat readFormat(DataTable original,
                                               com.csvreader.CsvReader reader,
                                               int header)
                                        throws java.io.IOException

      Note: in case if `original` is null and `header` is `HEADER_NAMES`, any null or empty headers in `reader` will be replaced by the string representation of the corresponding column number.
      Throws:
        `java.io.IOException`

    - #### fillEmptyHeaders

          public static boolean fillEmptyHeaders(com.csvreader.CsvReader reader)
                                          throws java.io.IOException

      Replaces all null or empty headers in `reader` by the string representation of the corresponding column number.
      Parameters:
        `reader` -
      Returns:
        true if and only if `reader` has been modified
      Throws:
        `java.io.IOException`