Class DefaultMapping
java.lang.Object
org.springframework.binding.mapping.impl.DefaultMapping
- All Implemented Interfaces:
Mapping
A single mapping definition, encapsulating the information necessary to map the result of evaluating an expression on
a source object to a property on a target object, optionally applying a type conversion during the mapping process.
- Author:
- Keith Donald, Scott Andrews
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultMapping(Expression sourceExpression, Expression targetExpression) Creates a new mapping. -
Method Summary
Modifier and TypeMethodDescriptionbooleanThe source of the mapping.The target of the mapping.Returns the type conversion executor to use during mapping execution.inthashCode()booleanWhether this is a required mapping.voidmap(DefaultMappingContext context) Execute this mapping.voidsetRequired(boolean required) Indicates if this mapping is a required mapping.voidsetTypeConverter(ConversionExecutor typeConverter) Sets a specific type conversion executor to use during mapping execution.toString()
-
Constructor Details
-
DefaultMapping
Creates a new mapping.- Parameters:
sourceExpression- the source expressiontargetExpression- the target expression
-
-
Method Details
-
getSourceExpression
Description copied from interface:MappingThe source of the mapping.- Specified by:
getSourceExpressionin interfaceMapping
-
getTargetExpression
Description copied from interface:MappingThe target of the mapping.- Specified by:
getTargetExpressionin interfaceMapping
-
isRequired
public boolean isRequired()Description copied from interface:MappingWhether this is a required mapping.- Specified by:
isRequiredin interfaceMapping
-
getTypeConverter
Returns the type conversion executor to use during mapping execution. May be null. -
setTypeConverter
Sets a specific type conversion executor to use during mapping execution.- Parameters:
typeConverter- the type converter
-
setRequired
public void setRequired(boolean required) Indicates if this mapping is a required mapping. Default is false.- Parameters:
required- required status
-
map
Execute this mapping.- Parameters:
context- the mapping context
-
equals
-
hashCode
public int hashCode() -
toString
-