ConversionSupport provides static utility methods for converting a
given object into an instance of a specified type.
| Modifier and Type | Field and Description |
|---|---|
| private static final List |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static < the type of the target T> @Nullable T | Returns: the converted object; may benull but only if the target
type is a reference typethe source source, Class<T> String to convert; may be null
but only if the target type is a reference typethe target type the source should be converted into;
never targetType, @Nullable ClassLoader nullthe classLoader)ClassLoader to use; may be null to
use the default ClassLoaderConvert the supplied source |
| private static Class |
| stringToObjectConverters | back to summary |
|---|---|
| private static final List<StringToObjectConverter> stringToObjectConverters | |
| ConversionSupport | back to summary |
|---|---|
| private ConversionSupport() | |
| convert | back to summary |
|---|---|
| public static <T> @Nullable T convert(@Nullable String source, Class<T> targetType, @Nullable ClassLoader classLoader) Convert the supplied source If the target type is Some forms of conversion require a This method is able to convert strings into primitive types and their
corresponding wrapper types ( If the target type is not covered by any of the above, a convention-based
conversion strategy will be used to convert the source Search Algorithm
If multiple suitable factory methods or constructors are discovered they will be ignored. If neither a single factory method nor a single constructor is found, the convention-based conversion strategy will not apply.
| |
| toWrapperType | back to summary |
|---|---|
| private static Class | |