org.mentawai.message
Class AbstractMessage

java.lang.Object
  extended by org.mentawai.message.AbstractMessage
All Implemented Interfaces:
Message
Direct Known Subclasses:
DefaultMessage

public abstract class AbstractMessage
extends java.lang.Object
implements Message

Author:
Sergio Oliveira

Field Summary
protected  MessageContext context
           
protected  java.lang.String id
           
protected  java.lang.String[] params
           
protected  java.lang.String tokenMarker
           
protected  java.util.Map<java.lang.String,java.lang.String> tokens
           
 
Constructor Summary
AbstractMessage(int id, MessageContext context)
           
AbstractMessage(int id, MessageContext context, java.util.Map<java.lang.String,java.lang.String> tokens)
           
AbstractMessage(int id, MessageContext context, java.util.Map<java.lang.String,java.lang.String> tokens, java.lang.String[] params)
           
AbstractMessage(java.lang.String id, MessageContext context)
           
AbstractMessage(java.lang.String id, MessageContext context, java.util.Map<java.lang.String,java.lang.String> tokens)
           
AbstractMessage(java.lang.String id, MessageContext context, java.util.Map<java.lang.String,java.lang.String> tokens, java.lang.String[] params)
           
 
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 setTokenMarker(java.lang.String tokenMarker)
           
 void setTokens(java.util.Map<java.lang.String,java.lang.String> tokens)
          Sets tokens or placeholders for this message.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

protected java.lang.String id

context

protected MessageContext context

tokens

protected java.util.Map<java.lang.String,java.lang.String> tokens

tokenMarker

protected java.lang.String tokenMarker

params

protected java.lang.String[] params
Constructor Detail

AbstractMessage

public AbstractMessage(java.lang.String id,
                       MessageContext context)

AbstractMessage

public AbstractMessage(java.lang.String id,
                       MessageContext context,
                       java.util.Map<java.lang.String,java.lang.String> tokens)

AbstractMessage

public AbstractMessage(java.lang.String id,
                       MessageContext context,
                       java.util.Map<java.lang.String,java.lang.String> tokens,
                       java.lang.String[] params)

AbstractMessage

public AbstractMessage(int id,
                       MessageContext context)

AbstractMessage

public AbstractMessage(int id,
                       MessageContext context,
                       java.util.Map<java.lang.String,java.lang.String> tokens)

AbstractMessage

public AbstractMessage(int id,
                       MessageContext context,
                       java.util.Map<java.lang.String,java.lang.String> tokens,
                       java.lang.String[] params)
Method Detail

getId

public java.lang.String getId()
Description copied from interface: Message
Gets the unique ID of this message. A message context cannot have two messages with the same id.

Specified by:
getId in interface Message
Returns:
The unique id of this message.

getContext

public MessageContext getContext()
Description copied from interface: Message
Gets the message context for this message.

Specified by:
getContext in interface Message
Returns:
The message context for this message.

setTokenMarker

public void setTokenMarker(java.lang.String tokenMarker)

setTokens

public void setTokens(java.util.Map<java.lang.String,java.lang.String> tokens)
Description copied from interface: Message
Sets tokens or placeholders for this message. A message can have tokens.

Specified by:
setTokens in interface Message
Parameters:
tokens - The tokens for this message.

getText

public java.lang.String getText(java.util.Locale loc)
Description copied from interface: Message
Gets the message text this message object represents.

Specified by:
getText in interface Message
Parameters:
loc - The locale of the message.
Returns:
The message text.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2005 Mentawai Team. All Rights Reserved.