Package com.bc.ceres.binding.converters
Class NumberConverter<T extends Number>
java.lang.Object
com.bc.ceres.binding.converters.NumberConverter<T>
- All Implemented Interfaces:
Converter<T>
- Direct Known Subclasses:
ByteConverter
,DoubleConverter
,FloatConverter
,IntegerConverter
,LongConverter
,ShortConverter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConverts a value of the type returned byConverter.getValueType()
to its plain text representation.Gets the value type.Converts a value from its plain text representation to a Java object instance of the type returned byConverter.getValueType()
.protected abstract T
parseNumber
(String value)
-
Constructor Details
-
NumberConverter
public NumberConverter()
-
-
Method Details
-
getValueType
Description copied from interface:Converter
Gets the value type.- Specified by:
getValueType
in interfaceConverter<T extends Number>
- Returns:
- The value type.
-
parse
Description copied from interface:Converter
Converts a value from its plain text representation to a Java object instance of the type returned byConverter.getValueType()
.- Specified by:
parse
in interfaceConverter<T extends Number>
- Parameters:
value
- The textual representation of the value.- Returns:
- The converted value.
- Throws:
ConversionException
- If the conversion fails.
-
parseNumber
- Throws:
NumberFormatException
-
format
Description copied from interface:Converter
Converts a value of the type returned byConverter.getValueType()
to its plain text representation.
-