站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.1.0 API 文档英文版

MessageCodesResolver (Spring Framework API 2.1) - Spring Framework 2.1.0 API 文档英文版


The Spring Framework

org.springframework.validation
Interface MessageCodesResolver

All Known Implementing Classes:
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).

Since:
1.0.1
Author:
Juergen Hoeller
See Also:
DataBinder.setMessageCodesResolver(org.springframework.validation.MessageCodesResolver), ObjectError, FieldError, MessageSourceResolvable.getCodes()

Method Summary
 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.
 

Method Detail

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.

Parameters:
errorCode - the error code used for rejecting the object
objectName - the name of the object
Returns:
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.

Parameters:
errorCode - the error code used for rejecting the value
objectName - the name of the object
field - the field name
fieldType - the field type (may be null if not determinable)
Returns:
the message codes to use

The Spring Framework

Copyright © 2002-2007 The Spring Framework.