public abstract class AbstractMapStrategy extends Object implements MapStrategy
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
logger |
Constructor and Description |
---|
AbstractMapStrategy(BeanMapper beanMapper,
Configuration configuration) |
Modifier and Type | Method and Description |
---|---|
Object |
convert(Object value,
Class<?> targetClass,
BeanFieldMatch beanFieldMatch)
Converts a value into the target class.
|
BeanMapper |
getBeanMapper() |
<T,S> BeanMatch |
getBeanMatch(Class<S> sourceClazz,
Class<T> targetClazz) |
Configuration |
getConfiguration() |
<S> ConstructorArguments |
getConstructorArguments(S source,
BeanMatch beanMatch) |
BeanConverter |
getConverterOptional(Class<?> sourceClass,
Class<?> targetClass) |
boolean |
isMappable(String packageName)
Verifies whether the package is part of the beans which may be mapped by the bean mapper.
|
boolean |
isMappableClass(Class<?> clazz)
Verifies whether the class is part of the beans which may be mapped by the BeanMapper.
|
<S,T> T |
processFields(S source,
T target,
BeanMatch beanMatch)
Try to match the source fields on the target fields from the given classes.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
map
public AbstractMapStrategy(BeanMapper beanMapper, Configuration configuration)
public Configuration getConfiguration()
public BeanMapper getBeanMapper()
public <S> ConstructorArguments getConstructorArguments(S source, BeanMatch beanMatch)
public Object convert(Object value, Class<?> targetClass, BeanFieldMatch beanFieldMatch)
value
- the value to converttargetClass
- the target classbeanFieldMatch
- contains the fields belonging to the source/target field matchpublic <S,T> T processFields(S source, T target, BeanMatch beanMatch)
S
- The source typeT
- The target typesource
- The source from which the values get copied.target
- The target to which the values get copied.beanMatch
- the matchup of source and targetpublic boolean isMappableClass(Class<?> clazz)
clazz
- the class to be verified against the allowed packagespublic boolean isMappable(String packageName)
packageName
- the packagepublic BeanConverter getConverterOptional(Class<?> sourceClass, Class<?> targetClass)
Copyright © 2015–2018 42 BV. All rights reserved.