Class AbstractMappingResult
java.lang.Object
org.springframework.binding.mapping.results.AbstractMappingResult
- All Implemented Interfaces:
Serializable
,MappingResult
- Direct Known Subclasses:
RequiredError
,SourceAccessError
,Success
,TargetAccessError
,TypeConversionError
Convenient base class for
MappingResult
implementations.- Author:
- Keith Donald
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract String
getCode()
The mapping result code; for example, "success" , "typeMismatch", "propertyNotFound", or "evaluationException".abstract Throwable
Get the cause of the error resultabstract Object
The actual value that was mapped to the target object.The mapping that executed for which this result pertains to.abstract Object
The original value of the source object that was to be mapped.abstract boolean
isError()
Indicates if this result is an error result.toString()
-
Constructor Details
-
AbstractMappingResult
Creates a new mapping result.- Parameters:
mapping
- the mapping this result is for.
-
-
Method Details
-
getMapping
Description copied from interface:MappingResult
The mapping that executed for which this result pertains to.- Specified by:
getMapping
in interfaceMappingResult
-
getCode
Description copied from interface:MappingResult
The mapping result code; for example, "success" , "typeMismatch", "propertyNotFound", or "evaluationException".- Specified by:
getCode
in interfaceMappingResult
-
isError
public abstract boolean isError()Description copied from interface:MappingResult
Indicates if this result is an error result.- Specified by:
isError
in interfaceMappingResult
-
getErrorCause
Description copied from interface:MappingResult
Get the cause of the error result- Specified by:
getErrorCause
in interfaceMappingResult
- Returns:
- the underyling cause, or null if this is not an error or there was no root cause.
-
getOriginalValue
Description copied from interface:MappingResult
The original value of the source object that was to be mapped. May be null if this result is an error on the source object.- Specified by:
getOriginalValue
in interfaceMappingResult
-
getMappedValue
Description copied from interface:MappingResult
The actual value that was mapped to the target object. Null if this result is an error.- Specified by:
getMappedValue
in interfaceMappingResult
-
toString
-