# ImportConfigurationExcel (ARX GUI Documentation)

org.deidentifier.arx.io

## Class ImportConfigurationExcel

- java.lang.Object
- - org.deidentifier.arx.io.ImportConfiguration
  - - org.deidentifier.arx.io.ImportConfigurationFile
    - - org.deidentifier.arx.io.ImportConfigurationExcel

-     public class ImportConfigurationExcel
      extends ImportConfigurationFile

  Configuration describing an Excel file This is used to describe Excel files. Both file types (XLS and XLSX) are supported. The file type can either be detected automatically by the file extension, or alternatively can be set manually. Furthermore there is a sheet index `sheetIndex`, which describes which sheet within the file should be used.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ImportConfigurationExcel.ExcelFileTypes` Valid file types for Excel files XLS is the "old" Excel file type, XLSX is the "new" Excel file type.

  - ### Field Summary

    - ### Fields inherited from class org.deidentifier.arx.io.ImportConfiguration

      `columns`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ImportConfigurationExcel(java.lang.String fileLocation, ImportConfigurationExcel.ExcelFileTypes excelFileType, int sheetIndex, boolean containsHeader)` Creates a new instance of this object.
    `ImportConfigurationExcel(java.lang.String fileLocation, int sheetIndex, boolean containsHeader)` Creates a new instance of this object without specifying the file type The file type will be detected automatically using the file extension.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addColumn(ImportColumn column)` Adds a single column to import from This makes sure that only `ImportColumnExcel` can be added, otherwise an `IllegalArgumentException` will be thrown.
    `boolean` | `getContainsHeader()` Indicates whether there actually is a header A header is not necessarily mandatory.
    `ImportConfigurationExcel.ExcelFileTypes` | `getExcelFileType()`
    `int` | `getSheetIndex()`
    `void` | `prepare(org.apache.poi.ss.usermodel.Row row)` Sets the indexes based on the header.
    `void` | `setContainsHeader(boolean containsHeader)`
    `void` | `setExcelFileType(ImportConfigurationExcel.ExcelFileTypes excelFileType)`
    `void` | `setSheetIndex(int sheetIndex)`

    - ### Methods inherited from class org.deidentifier.arx.io.ImportConfigurationFile

      `getFileLocation, setFileLocation`

    - ### Methods inherited from class org.deidentifier.arx.io.ImportConfiguration

      `getColumns`

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

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

- - ### Constructor Detail

    - #### ImportConfigurationExcel

          public ImportConfigurationExcel(java.lang.String fileLocation,
                                  ImportConfigurationExcel.ExcelFileTypes excelFileType,
                                  int sheetIndex,
                                  boolean containsHeader)

      Creates a new instance of this object.
      Parameters:
        `fileLocation` - `ImportConfigurationFile.setFileLocation(String)`
        `excelFileType` - `setExcelFileType(ExcelFileTypes)`
        `sheetIndex` - `setSheetIndex(int)`
        `containsHeader` - `setContainsHeader(boolean)`

    - #### ImportConfigurationExcel

          public ImportConfigurationExcel(java.lang.String fileLocation,
                                  int sheetIndex,
                                  boolean containsHeader)

      Creates a new instance of this object without specifying the file type The file type will be detected automatically using the file extension. By default "xlsx" is assumed. In case the file extension is "xls" the file type will be set to `ImportConfigurationExcel.ExcelFileTypes.XLS`.
      Parameters:
        `fileLocation` - `ImportConfigurationFile.setFileLocation(String)`
        `sheetIndex` - `sheetIndex`
        `containsHeader` - `containsHeader`

  - ### Method Detail

    - #### addColumn

          public void addColumn(ImportColumn column)

      Adds a single column to import from This makes sure that only `ImportColumnExcel` can be added, otherwise an `IllegalArgumentException` will be thrown.
      Specified by:
        `addColumn` in class `ImportConfiguration`
      Parameters:
        `column` - A single column to import from, `ImportColumnExcel`

    - #### getContainsHeader

          public boolean getContainsHeader()

      Indicates whether there actually is a header A header is not necessarily mandatory. This returns a boolean value that describes whether or not the configuration actually contains a header or not.
      Returns:
        `containsHeader`

    - #### getExcelFileType

          public ImportConfigurationExcel.ExcelFileTypes getExcelFileType()

      Returns:
        `#ExcelFileTypes`

    - #### getSheetIndex

          public int getSheetIndex()

      Returns:
        `sheetIndex`

    - #### prepare

          public void prepare(org.apache.poi.ss.usermodel.Row row)

      Sets the indexes based on the header.
      Parameters:
        `row` -

    - #### setContainsHeader

          public void setContainsHeader(boolean containsHeader)

      Parameters:
        `containsHeader` - `containsHeader`

    - #### setExcelFileType

          public void setExcelFileType(ImportConfigurationExcel.ExcelFileTypes excelFileType)

      Parameters:
        `excelFileType` - `#ExcelFileTypes`

    - #### setSheetIndex

          public void setSheetIndex(int sheetIndex)

      Parameters:
        `sheetIndex` - `sheetIndex`