Package net.sf.basedb.util.parser
Class FlatFileParser.ExcelData
java.lang.Object
net.sf.basedb.util.parser.FlatFileParser.Data
net.sf.basedb.util.parser.FlatFileParser.ExcelData
- Enclosing class:
- FlatFileParser
static class FlatFileParser.ExcelData extends FlatFileParser.Data
Subclass that is used to return data when the source file is an Excel
file. It will forward all get() methods to retrieve the data directly
from the Cell item in Excel.
-
Field Summary
Fields Modifier and Type Field Description private int
colOffset
private int
rowOffset
private XlsxToCsvUtil.SheetInfo
sheet
-
Constructor Summary
Constructors Constructor Description ExcelData(XlsxToCsvUtil.SheetInfo sheet, int lineOffset, int lineNo, int dataLineNo, String line, String[] columns, boolean emptyIsNull, boolean nullIsNull, boolean trimWhiteSpace)
Create a new data object. -
Method Summary
Modifier and Type Method Description Date
getDate(int index, Formatter<Date> parser, boolean nullIfException)
Get the value as a date.Double
getDouble(int index, NumberFormat parser, boolean nullIfException)
Get the value as a double.Float
getFloat(int index, NumberFormat parser, boolean nullIfException)
Get the value as a float.Integer
getInt(int index, NumberFormat parser, boolean nullIfException)
Get the value as an integer.Long
getLong(int index, NumberFormat parser, boolean nullIfException)
Get the value as a long.String
getString(int index)
Get the value in the specified column.
-
Field Details
-
sheet
-
rowOffset
private final int rowOffset -
colOffset
private final int colOffset
-
-
Constructor Details
-
ExcelData
ExcelData(XlsxToCsvUtil.SheetInfo sheet, int lineOffset, int lineNo, int dataLineNo, String line, String[] columns, boolean emptyIsNull, boolean nullIsNull, boolean trimWhiteSpace)Create a new data object.
-
-
Method Details
-
getString
Description copied from class:FlatFileParser.Data
Get the value in the specified column.- Overrides:
getString
in classFlatFileParser.Data
- Parameters:
index
- The index for the column, starting at 0- Returns:
- The value in the column
-
getInt
Description copied from class:FlatFileParser.Data
Get the value as an integer. The default implementation parses the string value with the given parser. If the source file is an Excel file, the numeric value may be retrieved directly.- Overrides:
getInt
in classFlatFileParser.Data
-
getLong
Description copied from class:FlatFileParser.Data
Get the value as a long. The default implementation parses the string value with the given parser. If the source file is an Excel file, the numeric value may be retrieved directly.- Overrides:
getLong
in classFlatFileParser.Data
-
getFloat
Description copied from class:FlatFileParser.Data
Get the value as a float. The default implementation parses the string value with the given parser. If the source file is an Excel file, the numeric value may be retrieved directly.- Overrides:
getFloat
in classFlatFileParser.Data
-
getDouble
Description copied from class:FlatFileParser.Data
Get the value as a double. The default implementation parses the string value with the given parser. If the source file is an Excel file, the numeric value may be retrieved directly.- Overrides:
getDouble
in classFlatFileParser.Data
-
getDate
Description copied from class:FlatFileParser.Data
Get the value as a date. The default implementation parses the string value with the given parser. If the source file is an Excel file, the date value may be retrieved directly.- Overrides:
getDate
in classFlatFileParser.Data
-