public class OverrideConfiguration extends Object implements Configuration
Constructor and Description |
---|
OverrideConfiguration(Configuration 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 |
addLogicSecuredCheck(LogicSecuredCheck logicSecuredCheck)
Add a check instance that takes the source and target instances and on the basis of those
two determines whether access must be provided
|
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).
|
Class |
determineTargetClass()
On the basis of the target, the targetClass will be determined
|
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.
|
BeanUnproxy |
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.
|
Boolean |
getEnforceSecuredProperties()
Property that determines if secured properties must be handled.
|
Map<Class<? extends LogicSecuredCheck>,LogicSecuredCheck> |
getLogicSecuredChecks() |
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.
|
RoleSecuredCheck |
getRoleSecuredCheck()
The RoleSecuredCheck is responsible for checking if a Principal may access
a field or method annotated with @BeanRoleSecured.
|
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.
|
Boolean |
isFlushEnabled()
Determines if flushing has been enabled.
|
Boolean |
mustFlush()
Works on the combination of the global flush setting (flushEnabled) and the specific flush
setting (flushAfterClear).
|
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 |
setEnforceSecuredProperties(Boolean enforceSecuredProperties)
Property that determines if secured properties must be handled.
|
void |
setFlushAfterClear(Boolean flushAfterClear)
Determines whether the flush-chain must be called after a clear has taken place.
|
void |
setFlushEnabled(Boolean flushEnabled)
Set whether flushing must be enabled.
|
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 |
setRoleSecuredCheck(RoleSecuredCheck roleSecuredCheck)
The RoleSecuredCheck is responsible for checking if a Principal may access
a field or method annotated with @BeanRoleSecured.
|
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() |
public OverrideConfiguration(Configuration configuration)
public List<String> getDownsizeSource()
Configuration
getDownsizeSource
in interface Configuration
public List<String> getDownsizeTarget()
Configuration
getDownsizeTarget
in interface Configuration
public Class getCollectionClass()
Configuration
getCollectionClass
in interface Configuration
public CollectionHandler getCollectionHandlerForCollectionClass()
Configuration
getCollectionHandlerForCollectionClass
in interface Configuration
public CollectionHandler getCollectionHandlerFor(Class<?> clazz)
Configuration
getCollectionHandlerFor
in interface Configuration
clazz
- class to find the correct collection handler forpublic Class getTargetClass()
Configuration
getTargetClass
in interface Configuration
public Object getTarget()
Configuration
getTarget
in interface Configuration
public Object getParent()
Configuration
getParent
in interface Configuration
public BeanInitializer getBeanInitializer()
getBeanInitializer
in interface Configuration
public BeanUnproxy getBeanUnproxy()
getBeanUnproxy
in interface Configuration
public BeanMatchStore getBeanMatchStore()
Configuration
getBeanMatchStore
in interface Configuration
public ClassStore getClassStore()
Configuration
getClassStore
in interface Configuration
public List<String> getPackagePrefixes()
getPackagePrefixes
in interface Configuration
public List<BeanConverter> getBeanConverters()
getBeanConverters
in interface Configuration
public Map<Class<? extends LogicSecuredCheck>,LogicSecuredCheck> getLogicSecuredChecks()
getLogicSecuredChecks
in interface Configuration
public List<CollectionHandler> getCollectionHandlers()
Configuration
getCollectionHandlers
in interface Configuration
public List<BeanPair> getBeanPairs()
Configuration
getBeanPairs
in interface Configuration
public Boolean isConverterChoosable()
isConverterChoosable
in interface Configuration
public void withoutDefaultConverters()
withoutDefaultConverters
in interface Configuration
public String getStrictSourceSuffix()
Configuration
getStrictSourceSuffix
in interface Configuration
public String getStrictTargetSuffix()
Configuration
getStrictTargetSuffix
in interface Configuration
public Boolean isApplyStrictMappingConvention()
Configuration
isApplyStrictMappingConvention
in interface Configuration
public StrictMappingProperties getStrictMappingProperties()
Configuration
getStrictMappingProperties
in interface Configuration
public Class<?> getPreferredCollectionClass()
Configuration
getPreferredCollectionClass
in interface Configuration
public CollectionFlusher getCollectionFlusher()
Configuration
getCollectionFlusher
in interface Configuration
public BeanCollectionUsage getCollectionUsage()
Configuration
getCollectionUsage
in interface Configuration
public Boolean isFlushAfterClear()
Configuration
isFlushAfterClear
in interface Configuration
public Boolean isFlushEnabled()
Configuration
isFlushEnabled
in interface Configuration
public Boolean mustFlush()
Configuration
mustFlush
in interface Configuration
public RoleSecuredCheck getRoleSecuredCheck()
Configuration
getRoleSecuredCheck
in interface Configuration
public Boolean getEnforceSecuredProperties()
Configuration
getEnforceSecuredProperties
in interface Configuration
public void addConverter(BeanConverter converter)
Configuration
addConverter
in interface Configuration
converter
- an instance of the class that contains the conversion method implementations
and inherits from the abstract BeanConverter class.public void addLogicSecuredCheck(LogicSecuredCheck logicSecuredCheck)
Configuration
addLogicSecuredCheck
in interface Configuration
logicSecuredCheck
- the check instance to registerpublic void addCollectionHandler(CollectionHandler collectionHandler)
Configuration
addCollectionHandler
in interface Configuration
collectionHandler
- the collection handler to registerpublic void addBeanPairWithStrictSource(Class source, Class target)
Configuration
addBeanPairWithStrictSource
in interface Configuration
source
- the source class that must match, also the strict side of the pairtarget
- the target class that must matchpublic void addBeanPairWithStrictTarget(Class source, Class target)
Configuration
addBeanPairWithStrictTarget
in interface Configuration
source
- the source class that must matchtarget
- the target class that must match, also the strict side of the pairpublic void addProxySkipClass(Class<?> clazz)
Configuration
addProxySkipClass
in interface Configuration
clazz
- the class that is added to the list of skipped classespublic void addPackagePrefix(Class<?> clazz)
Configuration
addPackagePrefix
in interface Configuration
clazz
- the class which sets the package prefix for all mappable classespublic void addPackagePrefix(String packagePrefix)
Configuration
addPackagePrefix
in interface Configuration
packagePrefix
- the String which sets the package prefix for all mappable classespublic void addAfterClearFlusher(AfterClearFlusher afterClearFlusher)
Configuration
addAfterClearFlusher
in interface Configuration
afterClearFlusher
- the flusher to be added to the call stack after a clear callpublic void setRoleSecuredCheck(RoleSecuredCheck roleSecuredCheck)
Configuration
setRoleSecuredCheck
in interface Configuration
roleSecuredCheck
- the new active RoleSecuredCheckpublic void setEnforceSecuredProperties(Boolean enforceSecuredProperties)
Configuration
setEnforceSecuredProperties
in interface Configuration
enforceSecuredProperties
- whether the handling of secured properties is enforcedpublic void setBeanInitializer(BeanInitializer beanInitializer)
setBeanInitializer
in interface Configuration
public void setBeanUnproxy(BeanUnproxy beanUnproxy)
setBeanUnproxy
in interface Configuration
public boolean isAddDefaultConverters()
isAddDefaultConverters
in interface Configuration
public void downsizeSource(List<String> includeFields)
Configuration
downsizeSource
in interface Configuration
includeFields
- The fields to be mapped to the target class.public void downsizeTarget(List<String> includeFields)
Configuration
downsizeTarget
in interface Configuration
includeFields
- The field that are allowed in the target class.public void setCollectionClass(Class collectionClass)
Configuration
setCollectionClass
in interface Configuration
collectionClass
- the class type of the collectionpublic void setTargetClass(Class targetClass)
Configuration
setTargetClass
in interface Configuration
targetClass
- the class type of the targetpublic void setTarget(Object target)
Configuration
setTarget
in interface Configuration
target
- the target instance to map topublic void setParent(Object parent)
Configuration
setParent
in interface Configuration
parent
- the parent of the active fieldpublic void setConverterChoosable(boolean converterChoosable)
setConverterChoosable
in interface Configuration
public Class determineTargetClass()
Configuration
determineTargetClass
in interface Configuration
public void setStrictSourceSuffix(String strictSourceSuffix)
Configuration
setStrictSourceSuffix
in interface Configuration
strictSourceSuffix
- the source classname suffix for a class to be treated as strictpublic void setStrictTargetSuffix(String strictTargetSuffix)
Configuration
setStrictTargetSuffix
in interface Configuration
strictTargetSuffix
- the target classname suffix for a class to be treated as strictpublic void setApplyStrictMappingConvention(Boolean applyStrictMappingConvention)
Configuration
setApplyStrictMappingConvention
in interface Configuration
applyStrictMappingConvention
- whether the strict mapping convention must be appliedpublic void setCollectionUsage(BeanCollectionUsage collectionUsage)
Configuration
setCollectionUsage
in interface Configuration
collectionUsage
- the collection usage to applypublic void setPreferredCollectionClass(Class<?> preferredCollectionClass)
Configuration
setPreferredCollectionClass
in interface Configuration
preferredCollectionClass
- the collection class to prefer for instantiationpublic void setFlushAfterClear(Boolean flushAfterClear)
Configuration
setFlushAfterClear
in interface Configuration
flushAfterClear
- true if the flush-chain must be calledpublic void setFlushEnabled(Boolean flushEnabled)
Configuration
setFlushEnabled
in interface Configuration
flushEnabled
- whether flushing has been enabledCopyright © 2015–2018 42 BV. All rights reserved.