Class MessageFormatMessageInterpolator
- java.lang.Object
-
- org.apache.deltaspike.core.impl.message.MessageFormatMessageInterpolator
-
- All Implemented Interfaces:
Serializable,MessageInterpolator
@ApplicationScoped @Alternative public class MessageFormatMessageInterpolator extends Object implements MessageInterpolator, Serializable
This is an Alternative implementation of aMessageInterpolatorwhich uses java.text.MessageFormat for formatting. Please note that for some EE containers you might need to add this <alternative> to all JARs and classpath entries beanx.xml files.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MessageFormatMessageInterpolator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringinterpolate(String messageTemplate, Serializable[] arguments, Locale locale)Replaces the arguments of the given message with the given arguments.
-
-
-
Method Detail
-
interpolate
public String interpolate(String messageTemplate, Serializable[] arguments, Locale locale)
Description copied from interface:MessageInterpolatorReplaces the arguments of the given message with the given arguments.- Specified by:
interpolatein interfaceMessageInterpolator- Parameters:
messageTemplate- 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
-
-