public interface Configuration
Modifier and Type | Method and Description |
---|---|
void |
addAfterClearFlusher(AfterClearFlusher afterClearFlusher)
After BeanMapper calls the clear() method on a collection, it will check for the
presence of AfterClearFlusher instances.
|
void |
addBeanPairWithStrictSource(Class source,
Class target)
Adds a new pair of classes of which the source is strict.
|
void |
addBeanPairWithStrictTarget(Class source,
Class target)
Adds a new pair of classes of which the target is strict.
|
void |
addCollectionHandler(CollectionHandler collectionHandler)
Registers a collection handler to the configuration.
|
void |
addConverter(BeanConverter converter)
Add a converter class (must inherit from abstract BeanConverter class) to the beanMapper.
|
void |
addPackagePrefix(Class<?> clazz)
Adds a package on the basis of a class.
|
void |
addPackagePrefix(String packagePrefix)
Adds a package on the basis of a class.
|
void |
addProxySkipClass(Class<?> clazz)
Add classes to skip while unproxying to prevent failing of the BeanMapper while mapping
proxy classes or classes containing synthetic fields (Like ENUM types).
|
boolean |
canReuse()
Used to determine whether the configuration can be reused and modified (Override config)
or whether it must be wrapped in a new configuration (Core config).
|
Class |
determineTargetClass() |
void |
downsizeSource(List<String> includeFields)
Sets the field to downsize the source class.
|
void |
downsizeTarget(List<String> includeFields)
Sets the only fields that are allowed in the target class.
|
List<BeanConverter> |
getBeanConverters() |
BeanInitializer |
getBeanInitializer() |
BeanMatchStore |
getBeanMatchStore()
Always use the CoreConfiguration beanmatch store
|
List<BeanPair> |
getBeanPairs()
Returns the entire list of strict bean pairs.
|
SkippingBeanUnproxy |
getBeanUnproxy() |
ClassStore |
getClassStore()
Always use the CoreConfiguration class store
|
Class |
getCollectionClass()
The class that represents the collection itself.
|
CollectionFlusher |
getCollectionFlusher()
Returns the collection clearer, which takes care of calling the clear method
on a collection.
|
CollectionHandler |
getCollectionHandlerFor(Class<?> clazz)
Finds the correction handler for the class.
|
CollectionHandler |
getCollectionHandlerForCollectionClass()
Finds the collection handler for the collection class, null if not exists
|
List<CollectionHandler> |
getCollectionHandlers()
Returns the list of registered collection handlers.
|
BeanCollectionUsage |
getCollectionUsage()
Returns the type of collection usage for the current collection mapping
|
List<String> |
getDownsizeSource()
When include fields are passed, BeanMapper will assume that the generation (or reuse)
of a dynamic class is required.
|
List<String> |
getDownsizeTarget()
When include fields are passed, BeanMapper will assume that the generation (or reuse)
of a dynamic class is required.
|
List<String> |
getPackagePrefixes() |
Object |
getParent()
The active parent for the field that is currently being mapped.
|
Class<?> |
getPreferredCollectionClass()
Gets the preferred collection class to be instantiated.
|
StrictMappingProperties |
getStrictMappingProperties()
Returns the collection of strictSourceSuffix, strictTargetSuffix and
applyStrictMappingConvention properties.
|
String |
getStrictSourceSuffix()
Returns the classname suffix that determines a source class is to be treated as strict
with regards to mapping.
|
String |
getStrictTargetSuffix()
Returns the classname suffix that determines a target class is to be treated as strict
with regards to mapping.
|
Object |
getTarget()
The target to map to.
|
Class |
getTargetClass()
The class that represents the target class.
|
boolean |
isAddDefaultConverters() |
Boolean |
isApplyStrictMappingConvention()
Determines if strict mapping convention will be applied.
|
Boolean |
isConverterChoosable() |
Boolean |
isFlushAfterClear()
Determines if the flush-chain must be called after a clear() operation on a
collection has taken place.
|
void |
setApplyStrictMappingConvention(Boolean applyStrictMappingConvention)
Determines if strict mapping convention will be applied.
|
void |
setBeanInitializer(BeanInitializer beanInitializer) |
void |
setBeanUnproxy(BeanUnproxy beanUnproxy) |
void |
setCollectionClass(Class collectionClass)
Sets the collection class of the collection.
|
void |
setCollectionUsage(BeanCollectionUsage collectionUsage)
Sets the collection usage for the current collection mapping
|
void |
setConverterChoosable(boolean converterChoosable) |
void |
setFlushAfterClear(Boolean flushAfterClear)
Determines whether the flush-chain must be called after a clear has taken place.
|
void |
setParent(Object parent)
The active parent for the field that is currently being mapped.
|
void |
setPreferredCollectionClass(Class<?> preferredCollectionClass)
Sets the preferred collection class to be instantiated.
|
void |
setStrictSourceSuffix(String strictSourceSuffix)
Sets the classname suffix that determines a source class is to be treated as strict
with regards to mapping.
|
void |
setStrictTargetSuffix(String strictTargetSuffix)
Sets the classname suffix that determines a target class is to be treated as strict
with regards to mapping.
|
void |
setTarget(Object target)
Sets the target.
|
void |
setTargetClass(Class targetClass)
Sets the target class.
|
void |
withoutDefaultConverters() |
List<String> getDownsizeTarget()
List<String> getDownsizeSource()
Class getCollectionClass()
Class getTargetClass()
Object getTarget()
Object getParent()
BeanInitializer getBeanInitializer()
SkippingBeanUnproxy getBeanUnproxy()
BeanMatchStore getBeanMatchStore()
ClassStore getClassStore()
List<BeanConverter> getBeanConverters()
List<CollectionHandler> getCollectionHandlers()
CollectionHandler getCollectionHandlerFor(Class<?> clazz)
clazz
- class to find the correct collection handler forCollectionHandler getCollectionHandlerForCollectionClass()
List<BeanPair> getBeanPairs()
Boolean isConverterChoosable()
void withoutDefaultConverters()
String getStrictSourceSuffix()
String getStrictTargetSuffix()
Boolean isApplyStrictMappingConvention()
StrictMappingProperties getStrictMappingProperties()
BeanCollectionUsage getCollectionUsage()
Class<?> getPreferredCollectionClass()
CollectionFlusher getCollectionFlusher()
Boolean isFlushAfterClear()
void addConverter(BeanConverter converter)
converter
- an instance of the class that contains the conversion method implementations
and inherits from the abstract BeanConverter class.void addCollectionHandler(CollectionHandler collectionHandler)
collectionHandler
- the collection handler to registervoid addBeanPairWithStrictSource(Class source, Class target)
source
- the source class that must match, also the strict side of the pairtarget
- the target class that must matchvoid addBeanPairWithStrictTarget(Class source, Class target)
source
- the source class that must matchtarget
- the target class that must match, also the strict side of the pairvoid addProxySkipClass(Class<?> clazz)
clazz
- the class that is added to the list of skipped classesvoid addPackagePrefix(Class<?> clazz)
clazz
- the class which sets the package prefix for all mappable classesvoid addPackagePrefix(String packagePrefix)
packagePrefix
- the String which sets the package prefix for all mappable classesvoid addAfterClearFlusher(AfterClearFlusher afterClearFlusher)
afterClearFlusher
- the flusher to be added to the call stack after a clear callvoid setBeanInitializer(BeanInitializer beanInitializer)
void setBeanUnproxy(BeanUnproxy beanUnproxy)
boolean isAddDefaultConverters()
void setConverterChoosable(boolean converterChoosable)
void downsizeSource(List<String> includeFields)
includeFields
- The fields to be mapped to the target class.void downsizeTarget(List<String> includeFields)
includeFields
- The field that are allowed in the target class.void setCollectionClass(Class collectionClass)
collectionClass
- the class type of the collectionvoid setTargetClass(Class targetClass)
targetClass
- the class type of the targetvoid setTarget(Object target)
target
- the target instance to map tovoid setParent(Object parent)
parent
- the parent of the active fieldboolean canReuse()
Class determineTargetClass()
void setStrictSourceSuffix(String strictSourceSuffix)
strictSourceSuffix
- the source classname suffix for a class to be treated as strictvoid setStrictTargetSuffix(String strictTargetSuffix)
strictTargetSuffix
- the target classname suffix for a class to be treated as strictvoid setApplyStrictMappingConvention(Boolean applyStrictMappingConvention)
applyStrictMappingConvention
- whether the strict mapping convention must be appliedvoid setCollectionUsage(BeanCollectionUsage collectionUsage)
collectionUsage
- the collection usage to applyvoid setPreferredCollectionClass(Class<?> preferredCollectionClass)
preferredCollectionClass
- the collection class to prefer for instantiationvoid setFlushAfterClear(Boolean flushAfterClear)
flushAfterClear
- true if the flush-chain must be calledCopyright © 2015–2017 42 BV. All rights reserved.