com.googlecode.sarasvati.env
Class AttributeConverters
java.lang.Object
com.googlecode.sarasvati.env.AttributeConverters
public class AttributeConverters
- extends Object
Static utility class for registering and using AttributeConverter
s.
Note that registering converts is NOT thread-safe, and should be done at
startup.
- Author:
- Paul Lorenz
AttributeConverters
public AttributeConverters()
objectToString
public static String objectToString(Object object)
stringToObject
public static <T> T stringToObject(String string,
Class<T> type)
stringToObject
public static <T> T stringToObject(String string,
Class<T> type,
T defaultValue)
setDefaultConverter
public static void setDefaultConverter(AttributeConverter converter)
getConverterForType
public static AttributeConverter getConverterForType(Class<?> type)
setConverterForType
public static void setConverterForType(Class<?> type,
AttributeConverter converter)