Class TargetAccessError
java.lang.Object
org.springframework.binding.mapping.results.AbstractMappingResult
org.springframework.binding.mapping.results.TargetAccessError
- All Implemented Interfaces:
Serializable
,MappingResult
Indicates an exception occurred accessing the target object to be mapped to. Used to report source
PropertyNotFoundException
errors and general EvaluationException
errors.- Author:
- Keith Donald
- See Also:
-
Constructor Summary
ConstructorDescriptionTargetAccessError
(Mapping mapping, Object originalValue, EvaluationException cause) Creates a new target access error. -
Method Summary
Modifier and TypeMethodDescriptiongetCode()
The mapping result code; for example, "success" , "typeMismatch", "propertyNotFound", or "evaluationException".Get the cause of the error resultThe actual value that was mapped to the target object.The original value of the source object that was to be mapped.boolean
isError()
Indicates if this result is an error result.Methods inherited from class org.springframework.binding.mapping.results.AbstractMappingResult
getMapping, toString
-
Constructor Details
-
TargetAccessError
Creates a new target access error.- Parameters:
originalValue
- the value that was attempted to be mappedcause
- the underlying evaluation exception that occurred
-
-
Method Details
-
getCode
Description copied from interface:MappingResult
The mapping result code; for example, "success" , "typeMismatch", "propertyNotFound", or "evaluationException".- Specified by:
getCode
in interfaceMappingResult
- Specified by:
getCode
in classAbstractMappingResult
-
isError
public boolean isError()Description copied from interface:MappingResult
Indicates if this result is an error result.- Specified by:
isError
in interfaceMappingResult
- Specified by:
isError
in classAbstractMappingResult
-
getErrorCause
Description copied from interface:MappingResult
Get the cause of the error result- Specified by:
getErrorCause
in interfaceMappingResult
- Specified by:
getErrorCause
in classAbstractMappingResult
- 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
- Specified by:
getOriginalValue
in classAbstractMappingResult
-
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
- Specified by:
getMappedValue
in classAbstractMappingResult
-