Package com.bc.ceres.binding
Interface Converter<T>
-
- All Known Implementing Classes:
AffineTransformConverter,ArrayConverter,BooleanConverter,BooleanExpressionConverter,ByteConverter,CharacterConverter,ClassConverter,ColorConverter,CssColorConverter,DateFormatConverter,DoubleConverter,EnumConverter,FileConverter,FloatConverter,FontConverter,GeneralExpressionConverter,IntegerConverter,IntervalConverter,JavaTypeConverter,JtsGeometryConverter,LongConverter,NumberConverter,NumberFormatConverter,PatternConverter,RectangleConverter,ShortConverter,StringConverter,UrlConverter
public interface Converter<T>AConverterprovides a strategy to convert a value of a certain type from plain text to a Java object and vice versa.- Since:
- 0.6
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stringformat(T value)Converts a value of the type returned bygetValueType()to its plain text representation.Class<? extends T>getValueType()Gets the value type.Tparse(String text)Converts a value from its plain text representation to a Java object instance of the type returned bygetValueType().
-
-
-
Method Detail
-
parse
T parse(String text) throws ConversionException
Converts a value from its plain text representation to a Java object instance of the type returned bygetValueType().- Parameters:
text- The textual representation of the value.- Returns:
- The converted value.
- Throws:
ConversionException- If the conversion fails.
-
format
String format(T value)
Converts a value of the type returned bygetValueType()to its plain text representation.- Parameters:
value- The value to be converted to text.- Returns:
- The textual representation of the value.
-
-