Top Description Methods
org.springframework.context

public Interface MessageSourceResolvable

Known Direct Implementers
org.springframework.context.support.DefaultMessageSourceResolvable, org.springframework.validation.beanvalidation.SpringValidatorAdapter.ResolvableAttribute
Annotations
@FunctionalInterface
Imports
org.springframework.lang.Nullable

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
MessageSource#getMessage(MessageSourceResolvable, java.util.Locale), org.springframework.validation.ObjectError, org.springframework.validation.FieldError

Method Summary

Modifier and TypeMethod and Description
public default Object[]

Returns:

an array of objects to be used as parameters to replace placeholders within the message text
getArguments
()

Return the array of arguments to be used to resolve this message.

public String[]

Returns:

a String array of codes which are associated with this message
getCodes
()

Return the codes to be used to resolve this message, in the order that they should get tried.

public default String

Returns:

the default message, or null if no default
getDefaultMessage
()

Return the default message to be used to resolve this message.

Method Detail

getArgumentsback to summary
public default Object[] getArguments()

Return the array of arguments to be used to resolve this message.

The default implementation simply returns null.

Returns:Object[]

an array of objects to be used as parameters to replace placeholders within the message text

Annotations
@Nullable
See Also
java.text.MessageFormat
getCodesback to summary
public 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.

Returns:String[]

a String array of codes which are associated with this message

Annotations
@Nullable
getDefaultMessageback to summary
public default String 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 enforces org.springframework.context.support.AbstractMessageSource#setUseCodeAsDefaultMessage for this particular message.

Returns:String

the default message, or null if no default

Annotations
@Nullable