public class DefaultMappingContext
extends java.lang.Object
Constructor and Description |
---|
DefaultMappingContext(java.lang.Object source,
java.lang.Object target) |
Modifier and Type | Method and Description |
---|---|
Mapping |
getCurrentMapping()
Returns the current mapping.
|
MappingResults |
getMappingResults()
Returns the mapping results recorded in this context.
|
java.lang.Object |
getSource()
The object being mapped from.
|
java.lang.Object |
getTarget()
The object being mapped to.
|
void |
setCurrentMapping(Mapping mapping)
Sets the current mapping.
|
void |
setRequiredErrorResult(java.lang.Object originalValue)
Indicates the current mapping ended with a 'required' error.
|
void |
setSourceAccessError(EvaluationException error)
Indicates a error occurred accessing the source mapping expression.
|
void |
setSuccessResult(java.lang.Object originalValue,
java.lang.Object mappedValue)
Indicates the current mapping completed successfully.
|
void |
setTargetAccessError(java.lang.Object originalValue,
EvaluationException error)
Indicates a error occurred accessing the target mapping expression.
|
void |
setTypeConversionErrorResult(java.lang.Object originalValue,
java.lang.Exception cause)
Indicates the current mapping ended with a 'type conversion' error.
|
public DefaultMappingContext(java.lang.Object source, java.lang.Object target)
public java.lang.Object getSource()
public java.lang.Object getTarget()
public Mapping getCurrentMapping()
public void setCurrentMapping(Mapping mapping)
mapping
- the mapping to make the current mappingpublic void setSuccessResult(java.lang.Object originalValue, java.lang.Object mappedValue)
originalValue
- the original value from the source of the mappingmappedValue
- the successfully mapped value, which may be different from the original if a type conversion
was performedpublic void setRequiredErrorResult(java.lang.Object originalValue)
originalValue
- the original source value that is empty (null or an empty string, typically)public void setTypeConversionErrorResult(java.lang.Object originalValue, java.lang.Exception cause)
originalValue
- the original source value that is empty (null or an empty string, typically)cause
- the actual type conversion exception that occurredpublic void setSourceAccessError(EvaluationException error)
error
- the error that occurredpublic void setTargetAccessError(java.lang.Object originalValue, EvaluationException error)
error
- the error that occurredpublic MappingResults getMappingResults()