Interface MessageInterpolator
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
DefaultMessageInterpolator,MessageFormatMessageInterpolator
public interface MessageInterpolator extends Serializable
Implementations are responsible to replace placeholders in a message with the final value.An application can provide a custom implementation as @Alternative.
A simple implementation which uses the
String.format(java.util.Locale, String, Object...)will be used by default.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stringinterpolate(String messageText, Serializable[] arguments, Locale locale)Replaces the arguments of the given message with the given arguments.
-
-
-
Method Detail
-
interpolate
String interpolate(String messageText, Serializable[] arguments, Locale locale)
Replaces the arguments of the given message with the given arguments.- Parameters:
messageText- the message text which has to be interpolatedarguments- a list of numbered and/or named arguments for the current messagelocale- to use for the formatting- Returns:
- the final (interpolated) message text if it was possible to replace the parameters with the given arguments, or the unmodified messageText otherwise
-
-