Package org.springframework.context
Interface MessageSourceResolvable
- All Known Implementing Classes:
DefaultMessageSourceResolvable
,FieldError
,ObjectError
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Interface for objects that are suitable for message resolution in a
MessageSource
.
Spring's own validation error classes implement this interface.
- Author:
- Juergen Hoeller
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault Object[]
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.default String
Return the default message to be used to resolve this message.
-
Method Details
-
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.- Returns:
- a String array of codes which are associated with this message
-
getArguments
Return the array of arguments to be used to resolve this message.The default implementation simply returns
null
.- Returns:
- an array of objects to be used as parameters to replace placeholders within the message text
- See Also:
-
getDefaultMessage
Return the default message to be used to resolve this message.The default implementation simply returns
null
. Note that the default message may be identical to the primary message code (getCodes()
), which effectively enforcesAbstractMessageSource.setUseCodeAsDefaultMessage(boolean)
for this particular message.- Returns:
- the default message, or
null
if no default
-