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
ConstructorDescriptionDefaultMapping
(Expression sourceExpression, Expression targetExpression) Creates a new mapping. -
Method Summary
Modifier and TypeMethodDescriptionboolean
The source of the mapping.The target of the mapping.Returns the type conversion executor to use during mapping execution.int
hashCode()
boolean
Whether this is a required mapping.void
map
(DefaultMappingContext context) Execute this mapping.void
setRequired
(boolean required) Indicates if this mapping is a required mapping.void
setTypeConverter
(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:Mapping
The source of the mapping.- Specified by:
getSourceExpression
in interfaceMapping
-
getTargetExpression
Description copied from interface:Mapping
The target of the mapping.- Specified by:
getTargetExpression
in interfaceMapping
-
isRequired
public boolean isRequired()Description copied from interface:Mapping
Whether this is a required mapping.- Specified by:
isRequired
in 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
-