public interface Message extends Serializable
Basic interface for all messages.
A Message is not a simple String but all the
information needed to create those Strings for multiple situations.
The situation ist determined by the used MessageContext.
| Modifier and Type | Method and Description |
|---|---|
Message |
argument(Collection<Serializable> arguments)
Argument.
|
Message |
argument(Serializable... arguments) |
Message |
argumentArray(Serializable[] arguments)
Argument array.
|
Object[] |
getArguments() |
String |
getTemplate() |
Message |
template(String messageTemplate) |
String |
toString()
Renders the Message to a String, using the
MessageContext
which created the Message. |
String |
toString(MessageContext messageContext)
Renders the Message to a String, using an
arbitrary
MessageContext. |
String |
toString(MessageContext messageContext,
String category)
Renders the Message to a String, using an
arbitrary
MessageContext. |
String |
toString(String category)
Renders the Message to a String, using the
MessageContext
which created the Message. |
Message template(String messageTemplate)
messageTemplate - message key (or inline-text) for the current messageMessage argument(Serializable... arguments)
arguments - numbered and/or named argument(s) for the current messageMessage argumentArray(Serializable[] arguments)
arguments - the argumentsMessage argument(Collection<Serializable> arguments)
arguments - the argumentsString getTemplate()
Object[] getArguments()
String toString()
MessageContext
which created the Message.String toString(MessageContext messageContext)
MessageContext.String toString(String category)
MessageContext
which created the Message.
While resolving the message we will
first search for a messageTemplate with the given category by
just adding a dot '_' and the category String to the
getTemplate().
If no such a template exists we will fallback to the version
without the category StringString toString(MessageContext messageContext, String category)
MessageContext.
While resolving the message we will
first search for a messageTemplate with the given category by
just adding a dot '_' and the category String to the
getTemplate().
If no such a template exists we will fallback to the version
without the category StringCopyright © 2011-2013 The Apache Software Foundation. All Rights Reserved.