org.formaria.aria.helper
Class MessageHelper

java.lang.Object
  extended by org.formaria.aria.helper.MessageHelper

public class MessageHelper
extends java.lang.Object

Formats messages (for 1.1.x JDKs)

Copyright (c) Formaria Ltd., 2008
License: see license.txt


Constructor Summary
MessageHelper()
           
 
Method Summary
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()
Method Detail

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