Class DefaultMessage
- java.lang.Object
-
- org.apache.deltaspike.core.impl.message.DefaultMessage
-
- All Implemented Interfaces:
Serializable,Message
@Typed public class DefaultMessage extends Object implements Message
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefaultMessage(MessageContext messageContext)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Messageargument(Serializable... arguments)Messageargument(Collection<Serializable> arguments)Argument.MessageargumentArray(Serializable[] arguments)Argument array.booleanequals(Object o)Attention, themessageContextis deliberately not part of the equation!Serializable[]getArguments()StringgetTemplate()inthashCode()Attention, themessageContextis deliberately not part of the equation!protected voidreset()reset settingsMessagetemplate(String messageTemplate)StringtoString()Renders the Message to a String, using theMessageContextwhich created the Message.StringtoString(String category)Renders the Message to a String, using theMessageContextwhich created the Message.StringtoString(MessageContext messageContext)Renders the Message to a String, using an arbitraryMessageContext.StringtoString(MessageContext messageContext, String category)Renders the Message to a String, using an arbitraryMessageContext.
-
-
-
Constructor Detail
-
DefaultMessage
public DefaultMessage(MessageContext messageContext)
Constructor- Parameters:
messageContext- message cotext
-
-
Method Detail
-
reset
protected void reset()
reset settings
-
argument
public Message argument(Serializable... arguments)
-
getTemplate
public String getTemplate()
- Specified by:
getTemplatein interfaceMessage- Returns:
- the message key (or plain text) of the current message
-
getArguments
public Serializable[] getArguments()
- Specified by:
getArgumentsin interfaceMessage- Returns:
- all named and numbered arguments
-
toString
public String toString()
Description copied from interface:MessageRenders the Message to a String, using theMessageContextwhich created the Message.
-
toString
public String toString(String category)
Description copied from interface:MessageRenders the Message to a String, using theMessageContextwhich 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 theMessage.getTemplate(). If no such template exists we will fall back to the version without the category String.DeltaSpike JSF messages e.g. distinguish between categories
"summary"and"detail"to allow a short and a more detailed explanation in Error, Warn and Info popups at the same time.
-
toString
public String toString(MessageContext messageContext)
Description copied from interface:MessageRenders the Message to a String, using an arbitraryMessageContext.
-
toString
public String toString(MessageContext messageContext, String category)
Description copied from interface:MessageRenders the Message to a String, using an arbitraryMessageContext. 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 theMessage.getTemplate(). If no such template exists we will fall back to the version without the category String.
-
equals
public boolean equals(Object o)
Attention, themessageContextis deliberately not part of the equation!
-
hashCode
public int hashCode()
Attention, themessageContextis deliberately not part of the equation!
-
argumentArray
public Message argumentArray(Serializable[] arguments)
Description copied from interface:MessageArgument array. Similar to argument except it is meant to handle an array being passed in via a chain.- Specified by:
argumentArrayin interfaceMessage- Parameters:
arguments- the arguments- Returns:
- the message
-
argument
public Message argument(Collection<Serializable> arguments)
Description copied from interface:MessageArgument. Similar to the other argument methods, this one handles collections.
-
-