Package com.grapecity.documents.excel
Class DataImportOptions
java.lang.Object
com.grapecity.documents.excel.DataImportOptions
The options for importing data to a range.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets columns selector.booleanDetermines whether to include column header as the first row when importing data.Determines how to handle insufficient space when importing data.Gets the item type provider.voidsetColumnsSelector(Function<Object, Object> value) Sets columns selector.voidsetIncludeColumnsHeader(boolean value) Determines whether to include column header as the first row when importing data.voidsetItemTypeProvider(Function<Object, Class<?>> value) Sets the item type provider.
-
Constructor Details
-
DataImportOptions
public DataImportOptions()
-
-
Method Details
-
getColumnsSelector
Gets columns selector. It selects columns to import. The default behavior is to auto-generate all columns.- Returns:
- The
Functionaccepts theIterable, array orResultSetto select columns.- Returns
int[](IntArrayin Kotlin) to select columns by indexes for the specifiedResultSet. - Returns
String[]to select columns by namesfor the specifiedResultSet, dictionary or custom object. - Returns property getter array
Function[](whereTis the element type of collection,Ris the property type)to select columns with custom column getters. In this case,getIncludeColumnsHeader()must befalse. Otherwise, an exception will be thrown. Because we don't know the column names. - Returns named property getter array
AbstractMap.SimpleEntry[](whereKis column nameString,Vis property getterFunction; For eachFunction,Tis the element type of collection,Ris the property type)to select columns with custom column names and custom column getters. In this case,getIncludeColumnsHeader()should betrue. Otherwise, the column names will be ignored.
- Returns
-
setColumnsSelector
Sets columns selector. It selects columns to import. The default behavior is to auto-generate all columns.- Parameters:
value- TheFunctionaccepts theIterable, array orResultSetto select columns.- Returns
int[](IntArrayin Kotlin) to select columns by indexes for the specifiedResultSet. - Returns
String[]to select columns by namesfor the specifiedResultSet, dictionary or custom object. - Returns property getter array
Function[](whereTis the element type of collection,Ris the property type)to select columns with custom column getters. In this case,getIncludeColumnsHeader()must befalse. Otherwise, an exception will be thrown. Because we don't know the column names. - Returns named property getter array
AbstractMap.SimpleEntry[](whereKis column nameString,Vis property getterFunction; For eachFunction,Tis the element type of collection,Ris the property type)to select columns with custom column names and custom column getters. In this case,getIncludeColumnsHeader()should betrue. Otherwise, the column names will be ignored.
- Returns
-
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 istrue.
-
getItemTypeProvider
Gets the item type provider. It gets item type from the specifiedIterableor 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. -
setItemTypeProvider
Sets the item type provider. It gets item type from the specifiedIterableor 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.
-