public class Map2BeanTransformer extends Object implements ToBeanTransformer<Map<String,Object>>
TypeMapping
and PreConfiguredBeanUtils
to mimic what Node2BeanTransformer does.Modifier and Type | Field and Description |
---|---|
static String |
METADATA_PREFIX
Properties starting with this prefix are considered metadata and are skipped during transformation.
|
Constructor and Description |
---|
Map2BeanTransformer(ComponentProvider componentProvider,
TypeMapping mapping,
PreConfiguredBeanUtils beanUtils)
Deprecated.
since 5.5.1 - Please use
Map2BeanTransformer(ComponentProvider, TypeMapping, PreConfiguredBeanUtils, BeanTypeResolver) instead. |
Map2BeanTransformer(ComponentProvider componentProvider,
TypeMapping mapping,
PreConfiguredBeanUtils beanUtils,
BeanTypeResolver beanTypeResolver) |
Modifier and Type | Method and Description |
---|---|
protected Object |
createInstance(Class<?> targetType) |
protected void |
handleMissingProperty(TransformationState state,
Object bean,
String sourcePropertyName,
Object sourcePropertyValue,
String missingPropertyMessage) |
protected Collection<Object> |
readCollection(TransformationState state) |
protected Map<String,Object> |
readMap(TransformationState state) |
protected Object |
readValue(TransformationState state) |
<T> T |
toBean(Map<String,Object> map,
Class<T> targetType) |
<T> TransformationResult<T> |
transform(Map<String,Object> map,
Class<T> targetType) |
public static final String METADATA_PREFIX
@Inject public Map2BeanTransformer(ComponentProvider componentProvider, TypeMapping mapping, PreConfiguredBeanUtils beanUtils, BeanTypeResolver beanTypeResolver)
@Deprecated public Map2BeanTransformer(ComponentProvider componentProvider, TypeMapping mapping, PreConfiguredBeanUtils beanUtils)
Map2BeanTransformer(ComponentProvider, TypeMapping, PreConfiguredBeanUtils, BeanTypeResolver)
instead.public <T> TransformationResult<T> transform(Map<String,Object> map, Class<T> targetType)
transform
in interface ToBeanTransformer<Map<String,Object>>
public <T> T toBean(Map<String,Object> map, Class<T> targetType) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException, ConfigurationParsingException
protected Object readValue(TransformationState state)
protected void handleMissingProperty(TransformationState state, Object bean, String sourcePropertyName, Object sourcePropertyValue, String missingPropertyMessage)
protected Collection<Object> readCollection(TransformationState state)
protected Map<String,Object> readMap(TransformationState state)
Copyright © 2003–2020 Magnolia International Ltd.. All rights reserved.