Package adams.flow.core
Class DefaultPropertyValueConverter
- java.lang.Object
-
- adams.flow.core.AbstractPropertyValueConverter
-
- adams.flow.core.DefaultPropertyValueConverter
-
- All Implemented Interfaces:
Serializable
public class DefaultPropertyValueConverter extends AbstractPropertyValueConverter
Default handler for primitives. Values for arrays are assumed to be blank-separated strings (one element per array value).- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefaultPropertyValueConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
convert(Class cls, String value)
Converts the variable value into the appropriate object, if possible.boolean
handles(Class cls)
Checks whether this converter handles the particular class.-
Methods inherited from class adams.flow.core.AbstractPropertyValueConverter
getConverters, initialize
-
-
-
-
Method Detail
-
handles
public boolean handles(Class cls)
Checks whether this converter handles the particular class.- Specified by:
handles
in classAbstractPropertyValueConverter
- Parameters:
cls
- the class to check- Returns:
- true if it supports it
-
convert
public Object convert(Class cls, String value) throws Exception
Converts the variable value into the appropriate object, if possible.- Specified by:
convert
in classAbstractPropertyValueConverter
- 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
-
-