Package com.twelvemonkeys.util.convert
Interface PropertyConverter
-
- All Known Implementing Classes:
Converter,ConverterImpl,DateConverter,DefaultConverter,NumberConverter,TimeConverter
public interface PropertyConverterConverts strings to objects and back.- Version:
- $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/util/convert/PropertyConverter.java#1 $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.ObjecttoObject(java.lang.String pString, java.lang.Class pType, java.lang.String pFormat)Converts the string to an object, using the given format for parsing.java.lang.StringtoString(java.lang.Object pObject, java.lang.String pFormat)Converts the object to a string, using the given format
-
-
-
Method Detail
-
toObject
java.lang.Object toObject(java.lang.String pString, java.lang.Class pType, java.lang.String pFormat) throws ConversionExceptionConverts the string to an object, using the given format for parsing.- Parameters:
pString- the string to convertpType- the type to convert to.PropertyConverterimplementations may choose to ignore this parameter.pFormat- the format used for parsing.PropertyConverterimplementations may choose to ignore this parameter. Also, implementations that require a parser format, should provide a default format, and allownullas the format argument.- Returns:
- the object created from the given string.
- Throws:
ConversionException- if the string could not be converted to the specified type and format.
-
toString
java.lang.String toString(java.lang.Object pObject, java.lang.String pFormat) throws ConversionExceptionConverts the object to a string, using the given format- Parameters:
pObject- the object to convertpFormat- the format used for parsing.PropertyConverterimplementations may choose to ignore this parameter. Also, implementations that require a parser format, should provide a default format, and allownullas the format argument.- Returns:
- the string representation of the object, on the correct format.
- Throws:
ConversionException- if the string could not be converted to the specified type and format.
-
-