Package net.sf.basedb.util.parser
Interface Mapper
- All Known Implementing Classes:
ColumnMapper
,CompoundMapper
,ConstantMapper
,CropStringMapper
,JepMapper
,NullIfExceptionMapper
public interface Mapper
Represents a mapping expression that gets a single value from
a line of data. A typical mapping expression
holds a reference to the column number or name, for example:
\1\ \row\ Row: \row\, Col:\col\ =2 * col('Radius')The actual syntax for the mapping string depends on the parser used.
- Version:
- 2.0
- Author:
- Nicklas
- See Also:
- Last modified
- $Date: 2019-04-11 09:31:26 +0200 (tors, 11 apr. 2019) $
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> T
getByType
(FlatFileParser.Data data, Type type) getDate
(FlatFileParser.Data data) Get the value for the line of data as a date.getDouble
(FlatFileParser.Data data) Get the value for the line of data as a double.getFloat
(FlatFileParser.Data data) Get the value for the line of data as a float.getInt
(FlatFileParser.Data data) Get the value for the line of data as an integer.getLong
(FlatFileParser.Data data) Get the value for the line of data as a long.getString
(FlatFileParser.Data data) Get the value for the line of data as a string.getValue
(FlatFileParser.Data data) Deprecated.
-
Method Details
-
getValue
Deprecated.In 3.15, usegetString(FlatFileParser.Data)
instead or one of the other getXxxx() methods to get a given data type directlyGet the value for the line of data.- Parameters:
data
- The line of data- Returns:
- A string value
-
getString
Get the value for the line of data as a string.- Parameters:
data
- The line of data- Returns:
- A string value
- Since:
- 3.15
-
getInt
Get the value for the line of data as an integer.- Parameters:
data
- The line of data- Returns:
- The value as an integer
- Throws:
NumberFormatException
- If the value can't be parsed as an integer
-
getLong
Get the value for the line of data as a long.- Parameters:
data
- The line of data- Returns:
- The value as an long
- Throws:
NumberFormatException
- If the value can't be parsed as an long- Since:
- 3.15
-
getFloat
Get the value for the line of data as a float.- Parameters:
data
- The line of data- Returns:
- The value as a float
- Throws:
NumberFormatException
- If the value can't be parsed as a float
-
getDouble
Get the value for the line of data as a double.- Parameters:
data
- The line of data- Returns:
- The value as a double
- Throws:
NumberFormatException
- If the value can't be parsed as a double- Since:
- 3.15
-
getDate
Get the value for the line of data as a date.- Parameters:
data
- The line of data- Returns:
- The value as a date
- Since:
- 3.15
-
getByType
-
getString(FlatFileParser.Data)
instead or one of the other getXxxx() methods to get a given data type directly