Class NullIfExceptionMapper

java.lang.Object
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: 2019-03-21 12:50:52 +0100 (tors, 21 mars 2019) $
  • Field Details

    • parent

      private final Mapper parent
  • Constructor Details

    • NullIfExceptionMapper

      public NullIfExceptionMapper​(Mapper parent)
      Create a new CropStringMapper.
      Parameters:
      parent - The parent mapper that does the actual mapping
  • Method Details

    • getValue

      @Deprecated public String getValue​(FlatFileParser.Data data)
      Deprecated.
      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
    • getString

      public String getString​(FlatFileParser.Data data)
      Description copied from interface: Mapper
      Get the value for the line of data as a string.
      Specified by:
      getString 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
    • getLong

      public Long getLong​(FlatFileParser.Data data)
      Description copied from interface: Mapper
      Get the value for the line of data as a long.
      Specified by:
      getLong in interface Mapper
      Parameters:
      data - The line of data
      Returns:
      The value as an long
    • 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
    • getDouble

      public Double getDouble​(FlatFileParser.Data data)
      Description copied from interface: Mapper
      Get the value for the line of data as a double.
      Specified by:
      getDouble in interface Mapper
      Parameters:
      data - The line of data
      Returns:
      The value as a double
    • getDate

      public Date getDate​(FlatFileParser.Data data)
      Description copied from interface: Mapper
      Get the value for the line of data as a date.
      Specified by:
      getDate in interface Mapper
      Parameters:
      data - The line of data
      Returns:
      The value as a date