public class FieldError extends ObjectError
See the DefaultMessageCodesResolver
javadoc for details on
how a message code list is built for a FieldError
.
DefaultMessageCodesResolver
,
Serialized FormConstructor and Description |
---|
FieldError(java.lang.String objectName,
java.lang.String field,
java.lang.Object rejectedValue,
boolean bindingFailure,
java.lang.String[] codes,
java.lang.Object[] arguments,
java.lang.String defaultMessage)
Create a new FieldError instance.
|
FieldError(java.lang.String objectName,
java.lang.String field,
java.lang.String defaultMessage)
Create a new FieldError instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
java.lang.String |
getField()
Return the affected field of the object.
|
java.lang.Object |
getRejectedValue()
Return the rejected field value.
|
int |
hashCode() |
boolean |
isBindingFailure()
Return whether this error represents a binding failure
(like a type mismatch); otherwise it is a validation failure.
|
java.lang.String |
toString()
Default implementation exposes the attributes of this MessageSourceResolvable.
|
contains, getObjectName, unwrap, wrap
getArguments, getCode, getCodes, getDefaultMessage, resolvableToString
public FieldError(java.lang.String objectName, java.lang.String field, java.lang.String defaultMessage)
objectName
- the name of the affected objectfield
- the affected field of the objectdefaultMessage
- the default message to be used to resolve this messagepublic FieldError(java.lang.String objectName, java.lang.String field, @Nullable java.lang.Object rejectedValue, boolean bindingFailure, @Nullable java.lang.String[] codes, @Nullable java.lang.Object[] arguments, @Nullable java.lang.String defaultMessage)
objectName
- the name of the affected objectfield
- the affected field of the objectrejectedValue
- the rejected field valuebindingFailure
- whether this error represents a binding failure
(like a type mismatch); else, it is a validation failurecodes
- the codes to be used to resolve this messagearguments
- the array of arguments to be used to resolve this messagedefaultMessage
- the default message to be used to resolve this messagepublic java.lang.String getField()
@Nullable public java.lang.Object getRejectedValue()
public boolean isBindingFailure()
public boolean equals(@Nullable java.lang.Object other)
equals
in class ObjectError
public int hashCode()
hashCode
in class ObjectError
public java.lang.String toString()
DefaultMessageSourceResolvable
resolvableToString()
.toString
in class ObjectError
DefaultMessageSourceResolvable.resolvableToString()