Package org.springframework.validation
Interface MessageCodeFormatter
- All Known Implementing Classes:
DefaultMessageCodesResolver.Format
public interface MessageCodeFormatter
A strategy interface for formatting message codes.- Since:
- 3.2
- Author:
- Chris Beams
- See Also:
DefaultMessageCodesResolver
,DefaultMessageCodesResolver.Format
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
format(String errorCode, String objectName, String field)
Build and return a message code consisting of the given fields, usually delimited byDefaultMessageCodesResolver.CODE_SEPARATOR
.
Method Detail
format
String format(String errorCode, String objectName, String field)
Build and return a message code consisting of the given fields, usually delimited byDefaultMessageCodesResolver.CODE_SEPARATOR
.- Parameters:
errorCode
- e.g.: "typeMismatch"objectName
- e.g.: "user"field
- e.g. "age"- Returns:
- concatenated message code, e.g.: "typeMismatch.user.age"
- See Also:
DefaultMessageCodesResolver.Format