Package adams.flow.core
Class AbstractPropertyValueConverter
- java.lang.Object
-
- adams.flow.core.AbstractPropertyValueConverter
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DefaultPropertyValueConverter
,WekaPropertyValueConverter
public abstract class AbstractPropertyValueConverter extends Object implements Serializable
Ancestor for custom helper classes for updating properties of objects.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPropertyValueConverter()
Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Object
convert(Class cls, String value)
Converts the variable value into the appropriate object, if possible.static String[]
getConverters()
Returns a list with classnames of converters.abstract boolean
handles(Class cls)
Checks whether this converter handles the particular class.protected void
initialize()
Initializes member variables.
-
-
-
Method Detail
-
initialize
protected void initialize()
Initializes member variables.
Default implementation does nothing.
-
handles
public abstract boolean handles(Class cls)
Checks whether this converter handles the particular class.- Parameters:
cls
- the class to check- Returns:
- true if it supports it
-
convert
public abstract Object convert(Class cls, String value) throws Exception
Converts the variable value into the appropriate object, if possible.- Parameters:
cls
- the type of the propertyvalue
- the string to convert- Returns:
- the converted value or null if it cannot be converted
- Throws:
Exception
- if conversion fails with an error
-
getConverters
public static String[] getConverters()
Returns a list with classnames of converters.- Returns:
- the converter classnames
-
-