Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mentawai.message
Class AbstractMessage  view AbstractMessage download AbstractMessage.java

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

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


Field Summary
protected  MessageContext context
           
protected  java.lang.String id
           
private static java.lang.String TOKEN_MARKER
           
protected  java.lang.String tokenMarker
           
protected  java.util.Map tokens
           
 
Constructor Summary
AbstractMessage(int id, MessageContext context)
           
AbstractMessage(int id, MessageContext context, java.util.Map tokens)
           
AbstractMessage(java.lang.String id, MessageContext context)
           
AbstractMessage(java.lang.String id, MessageContext context, java.util.Map tokens)
           
 
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 tokens)
          Sets tokens or placeholders for this message.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TOKEN_MARKER

private static final java.lang.String TOKEN_MARKER
See Also:
Constant Field Values

id

protected java.lang.String id

context

protected MessageContext context

tokens

protected java.util.Map tokens

tokenMarker

protected java.lang.String tokenMarker
Constructor Detail

AbstractMessage

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

AbstractMessage

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

AbstractMessage

public AbstractMessage(int id,
                       MessageContext context)

AbstractMessage

public AbstractMessage(int id,
                       MessageContext context,
                       java.util.Map tokens)
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

getContext

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

Specified by:
getContext in interface Message

setTokenMarker

public void setTokenMarker(java.lang.String tokenMarker)

setTokens

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

Specified by:
setTokens in interface 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

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).