Class CustomNumberConverter

java.lang.Object
org.csveed.bean.conversion.AbstractConverter<Number>
org.csveed.bean.conversion.CustomNumberConverter
All Implemented Interfaces:
Converter<Number>

public class CustomNumberConverter extends AbstractConverter<Number>
The Class CustomNumberConverter.
  • Constructor Details

    • CustomNumberConverter

      public CustomNumberConverter(Class<? extends Number> numberClass, boolean allowEmpty) throws IllegalArgumentException
      Instantiates a new custom number converter.
      Parameters:
      numberClass - the number class
      allowEmpty - the allow empty
      Throws:
      IllegalArgumentException - the illegal argument exception
    • CustomNumberConverter

      public CustomNumberConverter(Class<? extends Number> numberClass, NumberFormat numberFormat, boolean allowEmpty) throws IllegalArgumentException
      Instantiates a new custom number converter.
      Parameters:
      numberClass - the number class
      numberFormat - the number format
      allowEmpty - the allow empty
      Throws:
      IllegalArgumentException - the illegal argument exception
  • Method Details

    • fromString

      public Number fromString(String text) throws Exception
      Description copied from interface: Converter
      From string.
      Parameters:
      text - the text
      Returns:
      the k
      Throws:
      Exception - the exception
    • determineValue

      public Number determineValue(Object value)
      Determine value.
      Parameters:
      value - the value
      Returns:
      the number
    • toString

      public String toString(Number value) throws Exception
      Description copied from interface: Converter
      To string.
      Parameters:
      value - the value
      Returns:
      the string
      Throws:
      Exception - the exception