Class ConversionContext
- java.lang.Object
-
- de.gebit.integrity.parameter.conversion.ConversionContext
-
- All Implemented Interfaces:
Cloneable
public class ConversionContext extends Object implements Cloneable
A conversion context is a container for contextual information required to perform a value conversion.
This class is intended to be used in a Builder-style pattern.- Author:
- Rene Schneider - initial API and implementation
-
-
Field Summary
Fields Modifier and Type Field Description protected ComparisonResultcomparisonResultIn case of a value being converted which belongs to a comparison that has been executed, the result of said comparison can be provided.protected EmptyValueHandlingemptyValueHandlingPolicyThe way in whichEmptyValues are to be treated.protected InexistentValueHandlinginexistentValueHandlingPolicyThe way in whichInexistentValues are to be treated.protected Map<String,Object>propertiesMap to contain arbitrary information.protected RegexValueHandlingregexValueHandlingPolicyThe way in whichRegexValues are to be treated.protected booleanskipBeanToMapDefaultConversionWhether the default conversion applied to Java Bean classes (ObjectToMap) shall be skipped in the conversion search and no conversion at all shall be done instead.protected UnresolvableVariableHandlingunresolvableVariableHandlingPolicyThe way in which unresolvable variables shall be treated.
-
Constructor Summary
Constructors Constructor Description ConversionContext()Creates an instance with the default initial values.
-
Method Summary
-
-
-
Field Detail
-
skipBeanToMapDefaultConversion
protected boolean skipBeanToMapDefaultConversion
Whether the default conversion applied to Java Bean classes (ObjectToMap) shall be skipped in the conversion search and no conversion at all shall be done instead.
-
unresolvableVariableHandlingPolicy
protected UnresolvableVariableHandling unresolvableVariableHandlingPolicy
The way in which unresolvable variables shall be treated.
-
inexistentValueHandlingPolicy
protected InexistentValueHandling inexistentValueHandlingPolicy
The way in whichInexistentValues are to be treated.
-
regexValueHandlingPolicy
protected RegexValueHandling regexValueHandlingPolicy
The way in whichRegexValues are to be treated.
-
emptyValueHandlingPolicy
protected EmptyValueHandling emptyValueHandlingPolicy
The way in whichEmptyValues are to be treated.
-
comparisonResult
protected ComparisonResult comparisonResult
In case of a value being converted which belongs to a comparison that has been executed, the result of said comparison can be provided.
-
-
Method Detail
-
skipBeanToMapDefaultConversion
public ConversionContext skipBeanToMapDefaultConversion()
Enable skipping of the bean-to-map default conversion (ObjectToMap).- See Also:
skipBeanToMapDefaultConversion
-
withUnresolvableVariableHandlingPolicy
public ConversionContext withUnresolvableVariableHandlingPolicy(UnresolvableVariableHandling aPolicy)
Enables a certainUnresolvableVariableHandlingpolicy instead of the default.- Parameters:
aPolicy- the policy to use
-
withInexistentValueHandling
public ConversionContext withInexistentValueHandling(InexistentValueHandling aPolicy)
Enables a certainInexistentValueHandlingpolicy instead of the default.- Parameters:
aPolicy- the policy to use
-
withRegexValueHandling
public ConversionContext withRegexValueHandling(RegexValueHandling aPolicy)
Enables a certainRegexValueHandlingpolicy instead of the default.- Parameters:
aPolicy- the policy to use
-
withEmptyValueHandling
public ConversionContext withEmptyValueHandling(EmptyValueHandling aPolicy)
Enables a certainEmptyValueHandlingpolicy instead of the default.- Parameters:
aPolicy- the policy to use
-
withComparisonResult
public ConversionContext withComparisonResult(ComparisonResult aComparisonResult)
Adds the provided comparison result.- Parameters:
aComparisonResult- the comparison result to add
-
withProperty
public ConversionContext withProperty(String aKey, Object anObject)
Adds the provided property.- Parameters:
aKey- the keyanObject- the object
-
getSkipBeanToMapDefaultConversion
public boolean getSkipBeanToMapDefaultConversion()
-
getUnresolvableVariableHandlingPolicy
public UnresolvableVariableHandling getUnresolvableVariableHandlingPolicy()
-
getInexistentValueHandlingPolicy
public InexistentValueHandling getInexistentValueHandlingPolicy()
-
getRegexValueHandlingPolicy
public RegexValueHandling getRegexValueHandlingPolicy()
-
getEmptyValueHandlingPolicy
public EmptyValueHandling getEmptyValueHandlingPolicy()
-
getComparisonResult
public ComparisonResult getComparisonResult()
-
-