Package org.apache.metamodel.excel
Class ExcelConfiguration
java.lang.Object
org.apache.metamodel.util.BaseObject
org.apache.metamodel.excel.ExcelConfiguration
- All Implemented Interfaces:
Serializable
public final class ExcelConfiguration
extends org.apache.metamodel.util.BaseObject
implements Serializable
Represents the configuration for reading/parsing Excel spreadsheets.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionExcelConfiguration(int columnNameLineNumber, boolean skipEmptyLines, boolean skipEmptyColumns) ExcelConfiguration(int columnNameLineNumber, org.apache.metamodel.schema.naming.ColumnNamingStrategy columnNamingStrategy, boolean skipEmptyLines, boolean skipEmptyColumns) ExcelConfiguration(int columnNameLineNumber, org.apache.metamodel.schema.naming.ColumnNamingStrategy columnNamingStrategy, boolean skipEmptyLines, boolean skipEmptyColumns, boolean detectColumnTypes, int numberOfLinesToScan) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddecorateIdentity(List<Object> identifiers) intThe line number (1 based) from which to get the names of the columns.org.apache.metamodel.schema.naming.ColumnNamingStrategyGets aColumnNamingStrategyto use if needed.intThe number of lines to scan when detecting the column typesbooleanDefines if columns in the excel spreadsheet should be detected on data types while reading the spreadsheet.booleanDefines if empty columns in the excel spreadsheet should be skipped while reading the spreadsheet.booleanDefines if empty lines in the excel spreadsheet should be skipped while reading the spreadsheet.toString()Methods inherited from class org.apache.metamodel.util.BaseObject
classEquals, equals, hashCode
-
Field Details
-
NO_COLUMN_NAME_LINE
public static final int NO_COLUMN_NAME_LINE- See Also:
-
DEFAULT_COLUMN_NAME_LINE
public static final int DEFAULT_COLUMN_NAME_LINE- See Also:
-
DEFAULT_NUMBERS_OF_LINES_TO_SCAN
public static final int DEFAULT_NUMBERS_OF_LINES_TO_SCAN- See Also:
-
-
Constructor Details
-
ExcelConfiguration
public ExcelConfiguration() -
ExcelConfiguration
public ExcelConfiguration(int columnNameLineNumber, boolean skipEmptyLines, boolean skipEmptyColumns) -
ExcelConfiguration
public ExcelConfiguration(int columnNameLineNumber, org.apache.metamodel.schema.naming.ColumnNamingStrategy columnNamingStrategy, boolean skipEmptyLines, boolean skipEmptyColumns) -
ExcelConfiguration
public ExcelConfiguration(int columnNameLineNumber, org.apache.metamodel.schema.naming.ColumnNamingStrategy columnNamingStrategy, boolean skipEmptyLines, boolean skipEmptyColumns, boolean detectColumnTypes, int numberOfLinesToScan)
-
-
Method Details
-
getColumnNamingStrategy
public org.apache.metamodel.schema.naming.ColumnNamingStrategy getColumnNamingStrategy()Gets aColumnNamingStrategyto use if needed.- Returns:
-
getColumnNameLineNumber
public int getColumnNameLineNumber()The line number (1 based) from which to get the names of the columns. Note that this line number is affected by the skipEmptyLines property! If skipEmptyLines is set to true, the line numbers will begin from the first non-empty line.- Returns:
- the line number of the column headers/names.
-
isSkipEmptyLines
public boolean isSkipEmptyLines()Defines if empty lines in the excel spreadsheet should be skipped while reading the spreadsheet.- Returns:
- a boolean indicating whether or not to skip empty lines.
-
isSkipEmptyColumns
public boolean isSkipEmptyColumns()Defines if empty columns in the excel spreadsheet should be skipped while reading the spreadsheet.- Returns:
- a boolean indicating whether or not to skip empty columns.
-
isDetectColumnTypes
public boolean isDetectColumnTypes()Defines if columns in the excel spreadsheet should be detected on data types while reading the spreadsheet. If this detection configuration is set to false and there's no column name line configured, then all column types will be String. If this detection configuration is set to false and there's a column name line configured, then all column types will be VarChar.- Returns:
- a boolean indicating whether or not to validate column types.
-
getNumberOfLinesToScan
public int getNumberOfLinesToScan()The number of lines to scan when detecting the column types- Returns:
- an int indicating the numbers of lines that will be scanned
-
decorateIdentity
- Specified by:
decorateIdentityin classorg.apache.metamodel.util.BaseObject
-
toString
- Overrides:
toStringin classorg.apache.metamodel.util.BaseObject
-