[]
        
(Showing Draft Content)

DataImportOptions

Class DataImportOptions

java.lang.Object
com.grapecity.documents.excel.DataImportOptions

public class DataImportOptions extends Object
The options for importing data to a range.
  • Constructor Details

    • DataImportOptions

      public DataImportOptions()
  • Method Details

    • getColumnsSelector

      public Function<Object,Object> getColumnsSelector()
      Gets columns selector. It selects columns to import. The default behavior is to auto-generate all columns.
      Returns:
      The Function accepts the Iterable, array or ResultSet to select columns.
      • Returns int[] (IntArray in Kotlin) to select columns by indexes for the specified ResultSet.
      • Returns String[] to select columns by namesfor the specified ResultSet, dictionary or custom object.
      • Returns property getter array Function[](where T is the element type of collection, R is the property type)to select columns with custom column getters. In this case, getIncludeColumnsHeader() must be false. Otherwise, an exception will be thrown. Because we don't know the column names.
      • Returns named property getter array AbstractMap.SimpleEntry[](where K is column name String, V is property getter Function; For each Function, T is the element type of collection, R is the property type)to select columns with custom column names and custom column getters. In this case, getIncludeColumnsHeader() should be true. Otherwise, the column names will be ignored.
    • setColumnsSelector

      public void setColumnsSelector(Function<Object,Object> value)
      Sets columns selector. It selects columns to import. The default behavior is to auto-generate all columns.
      Parameters:
      value - The Function accepts the Iterable, array or ResultSet to select columns.
      • Returns int[] (IntArray in Kotlin) to select columns by indexes for the specified ResultSet.
      • Returns String[] to select columns by namesfor the specified ResultSet, dictionary or custom object.
      • Returns property getter array Function[](where T is the element type of collection, R is the property type)to select columns with custom column getters. In this case, getIncludeColumnsHeader() must be false. Otherwise, an exception will be thrown. Because we don't know the column names.
      • Returns named property getter array AbstractMap.SimpleEntry[](where K is column name String, V is property getter Function; For each Function, T is the element type of collection, R is the property type)to select columns with custom column names and custom column getters. In this case, getIncludeColumnsHeader() should be true. Otherwise, the column names will be ignored.
    • getInsufficientSpaceHandling

      public InsufficientSpaceHandling getInsufficientSpaceHandling()
      Determines how to handle insufficient space when importing data.
      Returns:
      The default value is InsufficientSpaceHandling.Overwrite.
    • getIncludeColumnsHeader

      public boolean getIncludeColumnsHeader()
      Determines whether to include column header as the first row when importing data.
      Returns:
      The default value is true.
    • setIncludeColumnsHeader

      public void setIncludeColumnsHeader(boolean value)
      Determines whether to include column header as the first row when importing data.
      Parameters:
      value - The default value is true.
    • getItemTypeProvider

      public Function<Object,Class<?>> getItemTypeProvider()
      Gets the item type provider. It gets item type from the specified Iterable or array.The type is used to generate columns. The default behavior is to try to get the item type from the array, then try to get type from the first item.
      Returns:
      The Function accepts the Iterable or array for getting element type.The Function returns the item Class of the Iterable or array.
    • setItemTypeProvider

      public void setItemTypeProvider(Function<Object,Class<?>> value)
      Sets the item type provider. It gets item type from the specified Iterable or array.The type is used to generate columns. The default behavior is to try to get the item type from the array, then try to get type from the first item.
      Parameters:
      value - The Function accepts the Iterable or array for getting element type.The Function returns the item Class of the Iterable or array.