net.sf.sfac.setting
Class TypeHelper<T>
java.lang.Object
net.sf.sfac.setting.TypeHelper<T>
- Type Parameters:
T - the data type
public abstract class TypeHelper<T>
- extends Object
Interface used to manage and identify a data type inside the Settings implementation.
This interface provides two method used to convert between string and the target data type. You will need to provide an instance
of this helper for each new type supported by the settings implementation.
- Author:
- Olivier Berlanger
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TypeHelper
public TypeHelper()
stringToObject
public abstract T stringToObject(String str)
throws Exception
- Convert a string to an object of the target data type.
- Parameters:
str - The string to convert.
- Returns:
- An object of the target data type.
- Throws:
Exception - If the conversion cannot be performed.
objectToString
public String objectToString(T obj)
- Convert an object of the target data type to a string.
- Parameters:
obj - An object of the target data type to convert.
- Returns:
- The converted string.
Copyright © 2012. All Rights Reserved.