2.17.2: 2011-06-17

net.sf.basedb.util.parser
Class NullIfExceptionMapper

java.lang.Object
  extended by net.sf.basedb.util.parser.NullIfExceptionMapper
All Implemented Interfaces:
Mapper

public class NullIfExceptionMapper
extends Object
implements Mapper

A mapper that returns null if there is an exception when parsing the input data. The actual mapping is delegated to a parent mapper.

Version:
2.4
Author:
nicklas
Last modified
$Date: 2008-09-11 22:08:14 +0200 (Thu, 11 Sep 2008) $

Field Summary
private  Mapper parent
           
 
Constructor Summary
NullIfExceptionMapper(Mapper parent)
          Create a new CropStringMapper.
 
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 the value for the line of data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

private final Mapper parent
Constructor Detail

NullIfExceptionMapper

public NullIfExceptionMapper(Mapper parent)
Create a new CropStringMapper.

Parameters:
parent - The parent mapper that does the actual mapping
Method Detail

getValue

public String getValue(FlatFileParser.Data data)
Description copied from interface: Mapper
Get the value for the line of data.

Specified by:
getValue in interface Mapper
Parameters:
data - The line of data
Returns:
A string value

getInt

public Integer getInt(FlatFileParser.Data data)
Description copied from interface: Mapper
Get the value for the line of data as an integer.

Specified by:
getInt in interface Mapper
Parameters:
data - The line of data
Returns:
The value as an integer

getFloat

public Float getFloat(FlatFileParser.Data data)
Description copied from interface: Mapper
Get the value for the line of data as a float.

Specified by:
getFloat in interface Mapper
Parameters:
data - The line of data
Returns:
The value as a float

2.17.2: 2011-06-17