class StringToClassConverter extends java.lang.Object implements StringToObjectConverter
| Constructor and Description |
|---|
StringToClassConverter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canConvert(java.lang.Class<?> targetType)
Determine if this converter can convert from a
String to the
supplied target type (which is guaranteed to be a wrapper type for
primitives — for example, Integer instead of int). |
java.lang.Object |
convert(java.lang.String source,
java.lang.Class<?> targetType)
Convert the supplied
String to the supplied target type (which is
guaranteed to be a wrapper type for primitives — for example,
Integer instead of int). |
java.lang.Object |
convert(java.lang.String className,
java.lang.Class<?> targetType,
java.lang.ClassLoader classLoader)
Convert the supplied
String to the supplied target type (which is
guaranteed to be a wrapper type for primitives — for example,
Integer instead of int). |
public boolean canConvert(java.lang.Class<?> targetType)
StringToObjectConverterString to the
supplied target type (which is guaranteed to be a wrapper type for
primitives — for example, Integer instead of int).canConvert in interface StringToObjectConverterpublic java.lang.Object convert(java.lang.String source,
java.lang.Class<?> targetType)
throws java.lang.Exception
StringToObjectConverterString to the supplied target type (which is
guaranteed to be a wrapper type for primitives — for example,
Integer instead of int).convert in interface StringToObjectConverterjava.lang.Exceptionpublic java.lang.Object convert(java.lang.String className,
java.lang.Class<?> targetType,
java.lang.ClassLoader classLoader)
throws java.lang.Exception
StringToObjectConverterString to the supplied target type (which is
guaranteed to be a wrapper type for primitives — for example,
Integer instead of int).
The default implementation simply delegates to StringToObjectConverter.convert(String, Class).
Can be overridden by concrete implementations of this interface that need
access to the supplied ClassLoader.
convert in interface StringToObjectConverterjava.lang.Exception