Package com.twelvemonkeys.util.convert
Interface PropertyConverter
- All Known Implementing Classes:
Converter
,DateConverter
,DefaultConverter
,NumberConverter
,TimeConverter
public interface PropertyConverter
Converts 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 $
- Author:
- Harald Kuhr, last modified by $Author: haku $
-
Method Summary
-
Method Details
-
toObject
Converts the string to an object, using the given format for parsing.- Parameters:
pString
- the string to convertpType
- the type to convert to.PropertyConverter
implementations may choose to ignore this parameter.pFormat
- the format used for parsing.PropertyConverter
implementations may choose to ignore this parameter. Also, implementations that require a parser format, should provide a default format, and allownull
as 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
Converts the object to a string, using the given format- Parameters:
pObject
- the object to convertpFormat
- the format used for parsing.PropertyConverter
implementations may choose to ignore this parameter. Also, implementations that require a parser format, should provide a default format, and allownull
as 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.
-