org.mentawai.message
Interface Message

All Known Implementing Classes:
AbstractMessage, DefaultMessage

public interface Message

Describes the behavior of a text message that can be displayed in web page. A messsage has an ID and a message context from where to get the message as text. Messages are localized and can have tokens.

Author:
Sergio Oliveira

Method Summary
 MessageContext getContext()
          Gets the message context for this message.
 String getId()
          Gets the unique ID of this message.
 String[] getParams()
          Gets params for this message.
 String getText(Locale loc)
          Gets the message text this message object represents.
 Map<String,String> getTokens()
          Gets tokens or placeholders for this message.
 void setTokens(Map<String,String> tokens)
          Sets tokens or placeholders for this message.
 

Method Detail

getId

String getId()
Gets the unique ID of this message. A message context cannot have two messages with the same id.

Returns:
The unique id of this message.

getContext

MessageContext getContext()
Gets the message context for this message.

Returns:
The message context for this message.

getText

String getText(Locale loc)
Gets the message text this message object represents.

Parameters:
loc - The locale of the message.
Returns:
The message text.

setTokens

void setTokens(Map<String,String> tokens)
Sets tokens or placeholders for this message. A message can have tokens.

Parameters:
tokens - The tokens for this message.

getTokens

Map<String,String> getTokens()
Gets tokens or placeholders for this message.


getParams

String[] getParams()
Gets params for this message.



Copyright © 2013. All Rights Reserved.