Package net.sf.basedb.util.parser
Class CropStringMapper
java.lang.Object
net.sf.basedb.util.parser.CropStringMapper
- All Implemented Interfaces:
Mapper
A mapper that crops a string if it is longer than a specified
length. The actual mapping is delegated to a parent mapper.
- Version:
- 2.0
- Author:
- nicklas
- Last modified
- $Date: 2019-03-21 12:50:52 +0100 (tors, 21 mars 2019) $
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCropStringMapper
(Mapper parent, int maxLength) Create a new CropStringMapper. -
Method Summary
Modifier and TypeMethodDescriptiongetDate
(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) Use the parent mapper to get the string value.getValue
(FlatFileParser.Data data) Deprecated.
-
Field Details
-
parent
-
maxLength
private final int maxLength
-
-
Constructor Details
-
CropStringMapper
Create a new CropStringMapper.- Parameters:
parent
- The parent mapper that does the actual mappingmaxLength
- The maximum length of stings
-
-
Method Details
-
getValue
Deprecated.Description copied from interface:Mapper
Get the value for the line of data. -
getString
Use the parent mapper to get the string value. Then check the length against the maximum length and crop if neccessary. -
getInt
Description copied from interface:Mapper
Get the value for the line of data as an integer. -
getLong
Description copied from interface:Mapper
Get the value for the line of data as a long. -
getFloat
Description copied from interface:Mapper
Get the value for the line of data as a float. -
getDouble
Description copied from interface:Mapper
Get the value for the line of data as a double. -
getDate
Description copied from interface:Mapper
Get the value for the line of data as a date.
-