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.
 java.lang.String getId()
          Gets the unique ID of this message.
 java.lang.String getText(java.util.Locale loc)
          Gets the message text this message object represents.
 void setTokens(java.util.Map<java.lang.String,java.lang.String> tokens)
          Sets tokens or placeholders for this message.
 

Method Detail

getId

java.lang.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

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

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

setTokens

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

Parameters:
tokens - The tokens for this message.


Copyright © 2005 Mentawai Team. All Rights Reserved.