Package com.bc.ceres.binding.converters
Class NumberFormatConverter
- java.lang.Object
-
- com.bc.ceres.binding.converters.NumberFormatConverter
-
-
Constructor Summary
Constructors Constructor Description NumberFormatConverter(NumberFormat format)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
format(Object value)
Converts a value of the type returned byConverter.getValueType()
to its plain text representation.Class<?>
getValueType()
Gets the value type.Object
parse(String text)
Converts a value from its plain text representation to a Java object instance of the type returned byConverter.getValueType()
.
-
-
-
Constructor Detail
-
NumberFormatConverter
public NumberFormatConverter(NumberFormat format)
-
-
Method Detail
-
getValueType
public Class<?> getValueType()
Description copied from interface:Converter
Gets the value type.- Specified by:
getValueType
in interfaceConverter<Object>
- Returns:
- The value type.
-
parse
public Object parse(String text) throws ConversionException
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<Object>
- Parameters:
text
- The textual representation of the value.- Returns:
- The converted value.
- Throws:
ConversionException
- If the conversion fails.
-
format
public String format(Object value)
Description copied from interface:Converter
Converts a value of the type returned byConverter.getValueType()
to its plain text representation.
-
-