接口 MessageSourceResolvable
public interface MessageSourceResolvable
Interface for objects that are suitable for message resolution in aMessageSource
.Spring's own validation error classes implement this interface.
- 作者:
- Juergen Hoeller
- 另请参阅:
MessageSource.getMessage(MessageSourceResolvable, java.util.Locale)
,ObjectError
,FieldError
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 Object[]
getArguments()
Return the array of arguments to be used to resolve this message.String[]
getCodes()
Return the codes to be used to resolve this message, in the order that they should get tried.String
getDefaultMessage()
Return the default message to be used to resolve this message.
方法详细资料
getCodes
String[] getCodes()
Return the codes to be used to resolve this message, in the order that they should get tried. The last code will therefore be the default one.- 返回:
- a String array of codes which are associated with this message
getArguments
Object[] getArguments()
Return the array of arguments to be used to resolve this message.- 返回:
- an array of objects to be used as parameters to replace placeholders within the message text
- 另请参阅:
MessageFormat
getDefaultMessage
String getDefaultMessage()
Return the default message to be used to resolve this message.- 返回:
- the default message, or
null
if no default