Top Description Methods
org.springframework.validation

public Interface MessageCodeFormatter

Known Direct Implementers
org.springframework.validation.DefaultMessageCodesResolver.Format
Annotations
@FunctionalInterface
Imports
org.springframework.lang.Nullable

A strategy interface for formatting message codes.
Author
Chris Beams
Since
3.2
See Also
DefaultMessageCodesResolver, DefaultMessageCodesResolver.Format

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

concatenated message code, e.g.: "typeMismatch.user.age"
format
(String
e.g.: "typeMismatch"
errorCode
,
String
e.g.: "user"
objectName
,
String
e.g. "age"
field
)

Build and return a message code consisting of the given fields, usually delimited by DefaultMessageCodesResolver#CODE_SEPARATOR.

Method Detail

formatback to summary
public String format(String errorCode, String objectName, String field)

Build and return a message code consisting of the given fields, usually delimited by DefaultMessageCodesResolver#CODE_SEPARATOR.

Parameters
errorCode:String

e.g.: "typeMismatch"

objectName:String

e.g.: "user"

field:String

e.g. "age"

Returns:String

concatenated message code, e.g.: "typeMismatch.user.age"

See Also
DefaultMessageCodesResolver.Format