public class ConverterUtil extends Object
| Constructor and Description |
|---|
ConverterUtil(FrameworkModel frameworkModel) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
convertIfPossible(Object source,
Class<T> targetType)
Convert the value of source to target-type value if possible
|
Converter<?,?> |
getConverter(Class<?> sourceType,
Class<?> targetType)
Get the Converter instance from
ExtensionLoader with the specified source and target type |
public ConverterUtil(FrameworkModel frameworkModel)
public Converter<?,?> getConverter(Class<?> sourceType, Class<?> targetType)
ExtensionLoader with the specified source and target typesourceType - the source typetargetType - the target typeExtensionLoader.getSupportedExtensionInstances()public <T> T convertIfPossible(Object source, Class<T> targetType)
T - the target typesource - the value of sourcetargetType - the target typenull if can't be convertedCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.