net.xoetrope.xui.helper
Class MessageHelper

java.lang.Object
  extended by net.xoetrope.xui.helper.MessageHelper

public class MessageHelper
extends java.lang.Object

    

Formats messages (for 1.1.x JDKs)

Copyright (c) Xoetrope Ltd., 1998-2003
License: see license.txt


Constructor Summary
MessageHelper()
          Setup this helper object.
 
Method Summary
static MessageHelper getInstance()
          Deprecated. access should be via the project
static java.lang.String getNextToken(java.lang.String message)
          Get the next token in the message
static java.lang.String replaceToken(java.lang.String message, java.lang.String key, java.lang.String replacement)
          Replace the tokens in a message
static java.lang.String replaceTokens(java.lang.String message)
          Replace/Strip the tokens in a message
static java.lang.String replaceTokens(java.lang.String message, java.lang.String replacement)
          Replace parts of a message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageHelper

public MessageHelper()
Setup this helper object. getInstance or the XProject getMessageHelper method should be used instead of calling this constructor.

Method Detail

getInstance

public static MessageHelper getInstance()
Deprecated. access should be via the project

Get an instance of the message helper

Returns:
the message helper

replaceTokens

public static java.lang.String replaceTokens(java.lang.String message,
                                             java.lang.String replacement)
Replace parts of a message

Parameters:
message - the raw message
replacement - the replace for the tokens
Returns:
the processed message

getNextToken

public static java.lang.String getNextToken(java.lang.String message)
Get the next token in the message

Parameters:
message - the raw message
Returns:
the first token

replaceTokens

public static java.lang.String replaceTokens(java.lang.String message)
Replace/Strip the tokens in a message

Parameters:
message - the raw messsage
Returns:
the precessed message

replaceToken

public static java.lang.String replaceToken(java.lang.String message,
                                            java.lang.String key,
                                            java.lang.String replacement)
Replace the tokens in a message

Parameters:
message - the raw messsage
key - the raw messsage the key/token to lookup/replace
replacement - the value to replace the token
Returns:
the precessed message