|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.parser.CompoundMapper
public class CompoundMapper
A compound mapper that gets its value by invoking multiple other mappers which are set in the constructor. This type of mapper is used to combine constant strings with column values.
Field Summary | |
---|---|
private List<Mapper> |
mappers
|
private boolean |
nullIfException
|
private NumberFormat |
parser
|
Constructor Summary | |
---|---|
CompoundMapper(List<Mapper> mappers)
Create a new compound mapper. |
|
CompoundMapper(List<Mapper> mappers,
NumberFormat parser)
Deprecated. Use CompoundMapper(List, NumberFormat, boolean) |
|
CompoundMapper(List<Mapper> mappers,
NumberFormat parser,
boolean nullIfException)
Create a new compound mapper, using a specific number formatter as it's parser. |
Method Summary | |
---|---|
Float |
getFloat(FlatFileParser.Data data)
Get the value for the line of data as a float. |
Integer |
getInt(FlatFileParser.Data data)
Get the value for the line of data as an integer. |
String |
getValue(FlatFileParser.Data data)
Get a value by invoking each mapper in the order they appear in the list and concatenating the result. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final List<Mapper> mappers
private final NumberFormat parser
private final boolean nullIfException
Constructor Detail |
---|
public CompoundMapper(List<Mapper> mappers)
mappers
- A list of other mappers that will be invoked in
the order they appear in the listpublic CompoundMapper(List<Mapper> mappers, NumberFormat parser)
CompoundMapper(List, NumberFormat, boolean)
mappers
- A list of other mappers that will be invoked in
the order they appear in the listparser
- The number format to use or null to use Float.valueOf()public CompoundMapper(List<Mapper> mappers, NumberFormat parser, boolean nullIfException)
mappers
- A list of other mappers that will be invoked in
the order they appear in the listparser
- The number format to use or null to use Float.valueOf()nullIfException
- If TRUE, the mapper returns null for unparsable numeric
values, otherwise an excption is thrownMethod Detail |
---|
public String getValue(FlatFileParser.Data data)
getValue
in interface Mapper
data
- The line of data
public Integer getInt(FlatFileParser.Data data)
Mapper
getInt
in interface Mapper
data
- The line of data
public Float getFloat(FlatFileParser.Data data)
Mapper
getFloat
in interface Mapper
data
- The line of data
public String toString()
toString
in class Object
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |