Interface StringToObjectConverter
- All Known Implementing Classes:
FallbackStringToObjectConverter
,StringToBooleanConverter
,StringToCharacterConverter
,StringToClassConverter
,StringToCommonJavaTypesConverter
,StringToEnumConverter
,StringToJavaTimeConverter
,StringToNumberConverter
interface StringToObjectConverter
Internal API for converting arguments of type
String
to a specified
target type.-
Method Summary
Modifier and TypeMethodDescriptionboolean
canConvert
(Class<?> targetType) default Object
convert
(String source, Class<?> targetType, ClassLoader classLoader)
-
Method Details
-
canConvert
-
convert
Convert the suppliedString
to the supplied target type (which is guaranteed to be a wrapper type for primitives — for example,Integer
instead ofint
).- Throws:
Exception
-
convert
default Object convert(String source, Class<?> targetType, ClassLoader classLoader) throws Exception Convert the suppliedString
to the supplied target type (which is guaranteed to be a wrapper type for primitives — for example,Integer
instead ofint
).The default implementation simply delegates to
convert(String, Class)
. Can be overridden by concrete implementations of this interface that need access to the suppliedClassLoader
.- Throws:
Exception
-