# ImportWizardModel (ARX GUI Documentation)

org.deidentifier.arx.gui.view.impl.wizard

## Class ImportWizardModel

- java.lang.Object
- - org.deidentifier.arx.gui.view.impl.wizard.ImportWizardModel

-     public class ImportWizardModel
      extends java.lang.Object

  Stores all of the data gathered by the wizard and offers means to access it This object is accessible to all pages of the wizard and can be used to store and/or retrieve data. It is mainly used to exchange data between multiple wizard pages. TODO Change to more elegant implementation (i.e. general key value storage)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ImportWizardModel.SourceType` Possible sources for importing data from.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DETECT_MAX_CHARS` Maximum number of chars to be loaded for detecting separators.
    `static int` | `PREVIEW_MAX_LINES` Maximum number of lines to be loaded for preview purposes.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ImportWizardModel(Model model)` Creates a new instance

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.nio.charset.Charset` | `getCharset()` Returns the charset
    `char` | `getCsvDelimiter()`
    `char` | `getCsvEscape()`
    `char[]` | `getCsvLinebreak()` Getter
    `char` | `getCsvQuote()` Getter
    `java.util.List<ImportColumn>` | `getEnabledColumns()` Returns list of enabled columns This iterates over `wizardColumns` and returns only the columns that are enabled `ImportWizardModelColumn.isEnabled()`.
    `int` | `getExcelSheetIndex()`
    `java.lang.String` | `getFileLocation()`
    `boolean` | `getFirstRowContainsHeader()`
    `java.sql.Connection` | `getJdbcConnection()`
    `java.util.List<java.lang.String>` | `getJdbcTables()`
    `java.util.List<org.apache.commons.math3.util.Pair<DataType<?>,java.lang.Double>>` | `getMatchingDataTypes(ImportWizardModelColumn column)` Returns a list of matching data types
    `java.util.List<java.lang.String[]>` | `getPreviewData()`
    `java.util.List<java.lang.String>` | `getPreviewData(ImportWizardModelColumn column)` Returns a list of strings containing the data for the given column This will only return the `previewData` for the given column rather than all of the preview data.
    `java.lang.String` | `getSelectedJdbcTable()`
    `ImportWizardModel.SourceType` | `getSourceType()`
    `java.util.List<ImportWizardModelColumn>` | `getWizardColumns()`
    `boolean` | `isPerformCleansing()`
    `void` | `setCharset(java.nio.charset.Charset charset)` Sets the charset
    `void` | `setCsvDelimiter(char csvDelimiter)`
    `void` | `setCsvEscape(char csvEscape)`
    `void` | `setCsvLinebreak(char[] csvLinebreak)` Setter
    `void` | `setCsvQuote(char csvQuote)` Setter
    `void` | `setExcelSheetIndex(int excelSheetIndex)`
    `void` | `setFileLocation(java.lang.String fileLocation)`
    `void` | `setFirstRowContainsHeader(boolean firstRowContainsHeader)`
    `void` | `setJdbcConnection(java.sql.Connection jdbcConnection)`
    `void` | `setJdbcTables(java.util.List<java.lang.String> jdbcTables)`
    `void` | `setPerformCleansing(boolean performCleansing)`
    `void` | `setPreviewData(java.util.List<java.lang.String[]> previewData)`
    `void` | `setSelectedJdbcTable(java.lang.String selectedJdbcTable)`
    `void` | `setSourceType(ImportWizardModel.SourceType sourceType)` Setter
    `void` | `setWizardColumns(java.util.List<ImportWizardModelColumn> columns)`

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

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

- - ### Field Detail

    - #### PREVIEW_MAX_LINES

          public static final int PREVIEW_MAX_LINES

      Maximum number of lines to be loaded for preview purposes.
      See Also:
        Constant Field Values

    - #### DETECT_MAX_CHARS

          public static final int DETECT_MAX_CHARS

      Maximum number of chars to be loaded for detecting separators.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ImportWizardModel

          public ImportWizardModel(Model model)

      Creates a new instance
      Parameters:
        `model` -

  - ### Method Detail

    - #### getCharset

          public java.nio.charset.Charset getCharset()

      Returns the charset
      Returns:

    - #### getCsvDelimiter

          public char getCsvDelimiter()

      Returns:
        the csvDelimiter

    - #### getCsvEscape

          public char getCsvEscape()

      Returns:
        `csvEscape`

    - #### getCsvLinebreak

          public char[] getCsvLinebreak()

      Getter
      Returns:

    - #### getCsvQuote

          public char getCsvQuote()

      Getter
      Returns:

    - #### getEnabledColumns

          public java.util.List<ImportColumn> getEnabledColumns()

      Returns list of enabled columns This iterates over `wizardColumns` and returns only the columns that are enabled `ImportWizardModelColumn.isEnabled()`. Columns that have been disabled by the user will not be returned.
      Returns:
        `ImportColumn` List of enabled columns

    - #### getExcelSheetIndex

          public int getExcelSheetIndex()

      Returns:
        `excelSheetIndex`

    - #### getFileLocation

          public java.lang.String getFileLocation()

      Returns:
        `fileLocation`

    - #### getFirstRowContainsHeader

          public boolean getFirstRowContainsHeader()

      Returns:
        `firstRowContainsHeader`

    - #### getJdbcConnection

          public java.sql.Connection getJdbcConnection()

      Returns:
        `jdbcConnection`

    - #### getJdbcTables

          public java.util.List<java.lang.String> getJdbcTables()

      Returns:
        `jdbcTables`

    - #### getMatchingDataTypes

          public java.util.List<org.apache.commons.math3.util.Pair<DataType<?>,java.lang.Double>> getMatchingDataTypes(ImportWizardModelColumn column)

      Returns a list of matching data types
      Parameters:
        `column` -

    - #### getPreviewData

          public java.util.List<java.lang.String[]> getPreviewData()

      Returns:
        `previewData`

    - #### getPreviewData

          public java.util.List<java.lang.String> getPreviewData(ImportWizardModelColumn column)

      Returns a list of strings containing the data for the given column This will only return the `previewData` for the given column rather than all of the preview data.
      Parameters:
        `column` - Column the preview data should be returned for
      Returns:
        Data for the given column
      See Also:
        `#getPreviewData()}`

    - #### getSelectedJdbcTable

          public java.lang.String getSelectedJdbcTable()

      Returns:
        `selectedJdbcTable`

    - #### getSourceType

          public ImportWizardModel.SourceType getSourceType()

      Returns:
        `sourceType`

    - #### getWizardColumns

          public java.util.List<ImportWizardModelColumn> getWizardColumns()

      Returns:
        `wizardColumns`

    - #### isPerformCleansing

          public boolean isPerformCleansing()

      Returns:
        the performCleansing

    - #### setCharset

          public void setCharset(java.nio.charset.Charset charset)

      Sets the charset
      Parameters:
        `charset` -

    - #### setCsvDelimiter

          public void setCsvDelimiter(char csvDelimiter)

      Parameters:
        `csvDelimiter` - the csvDelimiter to set

    - #### setCsvEscape

          public void setCsvEscape(char csvEscape)

      Parameters:
        `csvEscape` -

    - #### setCsvLinebreak

          public void setCsvLinebreak(char[] csvLinebreak)

      Setter
      Parameters:
        `csvLinebreak` -

    - #### setCsvQuote

          public void setCsvQuote(char csvQuote)

      Setter
      Parameters:
        `csvQuote` -

    - #### setExcelSheetIndex

          public void setExcelSheetIndex(int excelSheetIndex)

      Parameters:
        `excelSheetIndex` - `excelSheetIndex`

    - #### setFileLocation

          public void setFileLocation(java.lang.String fileLocation)

      Parameters:
        `fileLocation` - `fileLocation`

    - #### setFirstRowContainsHeader

          public void setFirstRowContainsHeader(boolean firstRowContainsHeader)

      Parameters:
        `firstRowContainsHeader` - `firstRowContainsHeader`

    - #### setJdbcConnection

          public void setJdbcConnection(java.sql.Connection jdbcConnection)

      Parameters:
        `jdbcConnection` -

    - #### setJdbcTables

          public void setJdbcTables(java.util.List<java.lang.String> jdbcTables)

      Parameters:
        `jdbcTables` - `jdbcTables`

    - #### setPerformCleansing

          public void setPerformCleansing(boolean performCleansing)

      Parameters:
        `performCleansing` - the performCleansing to set

    - #### setPreviewData

          public void setPreviewData(java.util.List<java.lang.String[]> previewData)

      Parameters:
        `previewData` -

    - #### setSelectedJdbcTable

          public void setSelectedJdbcTable(java.lang.String selectedJdbcTable)

      Parameters:
        `selectedJdbcTable` - `selectedJdbcTable`

    - #### setSourceType

          public void setSourceType(ImportWizardModel.SourceType sourceType)

      Setter
      Parameters:
        `sourceType` -

    - #### setWizardColumns

          public void setWizardColumns(java.util.List<ImportWizardModelColumn> columns)

      Parameters:
        `columns` - `wizardColumns`