接口 MessageCodesResolver
- 所有已知实现类:
DefaultMessageCodesResolver
public interface MessageCodesResolver
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).
- 从以下版本开始:
- 1.0.1
- 作者:
- Juergen Hoeller
- 另请参阅:
DataBinder.setMessageCodesResolver(org.springframework.validation.MessageCodesResolver)
,ObjectError
,FieldError
,MessageSourceResolvable.getCodes()
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 String[]
resolveMessageCodes(String errorCode, String objectName)
Build message codes for the given error code and object name.String[]
resolveMessageCodes(String errorCode, String objectName, String field, Class<?> fieldType)
Build message codes for the given error code and field specification.
方法详细资料
resolveMessageCodes
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.- 参数:
errorCode
- the error code used for rejecting the objectobjectName
- the name of the object- 返回:
- the message codes to use
resolveMessageCodes
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.- 参数:
errorCode
- the error code used for rejecting the valueobjectName
- the name of the objectfield
- the field namefieldType
- the field type (may benull
if not determinable)- 返回:
- the message codes to use