public final class FromStringConverter extends Object implements Converter
String to any class which has a single argument
public constructor taking a String.
This should only be used as a fall-back converter, as a last attempt.
| Constructor and Description |
|---|
FromStringConverter() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
convert(Object source,
Class<T> toClass)
Attempt to convert a given object to a named class.
|
public <T> T convert(Object source, Class<T> toClass) throws Exception
Converterconvert in interface ConverterT - The class to convert to.source - The object to convert.toClass - The class to convert to.Exception - Any exception may be throw by a Converter on error.