public interface Message extends Serializable
A Message is not a simple String but all the information needed to create those Strings for multiple
situations. The situation is 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 plain 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 an underscore '_' and
the category String to the getTemplate(). If no such template exists we will fall back to the version
without the category String.String toString(MessageContext messageContext, String category)
MessageContext. While resolving the message we will
first search for a messageTemplate with the given category by just adding an underscore '_' and the category
String to the getTemplate(). If no such template exists we will fall back to the version without the
category String.Copyright © 2015 The Apache Software Foundation. All rights reserved.