Top Description Methods
org.springframework.validation

public Interface MessageCodesResolver

Known Direct Implementers
org.springframework.validation.DefaultMessageCodesResolver
Imports
org.springframework.lang.Nullable

Strategy interface for building message codes from validation error codes. Used by DataBinder to build the codes list for ObjectErrors and FieldErrors.

The resulting message codes correspond to the codes of a MessageSourceResolvable (as implemented by ObjectError and FieldError).

Author
Juergen Hoeller
Since
1.0.1
See Also
DataBinder#setMessageCodesResolver, ObjectError, FieldError, org.springframework.context.MessageSourceResolvable#getCodes()

Method Summary

Modifier and TypeMethod and Description
public String[]

Returns:

the message codes to use
resolveMessageCodes
(String
the error code used for rejecting the object
errorCode
,
String
the name of the object
objectName
)

Build message codes for the given error code and object name.

public String[]

Returns:

the message codes to use
resolveMessageCodes
(String
the error code used for rejecting the value
errorCode
,
String
the name of the object
objectName
,
String
the field name
field
,
Class<?>
the field type (may be null if not determinable)
fieldType
)

Build message codes for the given error code and field specification.

Method Detail

resolveMessageCodesback to summary
public String[] resolveMessageCodes(String errorCode, String objectName)

Build message codes for the given error code and object name. Used for building the codes list of an ObjectError.

Parameters
errorCode:String

the error code used for rejecting the object

objectName:String

the name of the object

Returns:String[]

the message codes to use

resolveMessageCodesback to summary
public String[] resolveMessageCodes(String errorCode, String objectName, String field, Class<?> fieldType)

Build message codes for the given error code and field specification. Used for building the codes list of an FieldError.

Parameters
errorCode:String

the error code used for rejecting the value

objectName:String

the name of the object

field:String

the field name

fieldType:Class<?>

the field type (may be null if not determinable)

Returns:String[]

the message codes to use