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(String objectName,
String field,
Object rejectedValue,
boolean bindingFailure,
String[] codes,
Object[] arguments,
String defaultMessage)
Create a new FieldError instance.
|
FieldError(String objectName,
String field,
String defaultMessage)
Create a new FieldError instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
String |
getField()
Return the affected field of the object.
|
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.
|
String |
toString()
The default implementation exposes the attributes of this MessageSourceResolvable.
|
contains, getObjectName, unwrap, wrap
getArguments, getCode, getCodes, getDefaultMessage, resolvableToString, shouldRenderDefaultMessage
public FieldError(String objectName, String field, 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(String objectName, String field, @Nullable Object rejectedValue, boolean bindingFailure, @Nullable String[] codes, @Nullable Object[] arguments, @Nullable 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 String getField()
public boolean isBindingFailure()
public boolean equals(@Nullable Object other)
equals
in class ObjectError
public int hashCode()
hashCode
in class ObjectError
public String toString()
DefaultMessageSourceResolvable
To be overridden in more specific subclasses, potentially including the
resolvable content through resolvableToString()
.
toString
in class ObjectError
DefaultMessageSourceResolvable.resolvableToString()