org.slim3.commons.message
Class MessageBuilder

java.lang.Object
  extended by org.slim3.commons.message.MessageBuilder

public final class MessageBuilder
extends Object

A class to build a message.

Since:
3.0
Author:
higa

Method Summary
protected static String calculateBundleName(String messageCode)
          Calculates the bundle name for the message code.
protected static String calculateKey(String messageCode)
          Calculates the key for the message code.
static String getMessage(Locale locale, String messageCode, Object... args)
          Returns the message.
static String getMessage(String messageCode, Object... args)
          Returns the message.
protected static String getMessageByArgs(Object... args)
          Returns the message built by the arguments.
protected static String getPattern(Locale locale, String messageCode)
          Returns the pattern of MessageFormat.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMessage

public static String getMessage(String messageCode,
                                Object... args)
Returns the message.

Parameters:
messageCode - the message code
args - the arguments
Returns:
the message

getMessage

public static String getMessage(Locale locale,
                                String messageCode,
                                Object... args)
Returns the message.

Parameters:
locale - the locale
messageCode - the message code
args - the arguments
Returns:
the message

getMessageByArgs

protected static String getMessageByArgs(Object... args)
Returns the message built by the arguments.

Parameters:
args - the arguments
Returns:
a message

getPattern

protected static String getPattern(Locale locale,
                                   String messageCode)
Returns the pattern of MessageFormat.

Parameters:
locale - the locale
messageCode - the message code
Returns:
the pattern of MessageFormat

calculateBundleName

protected static String calculateBundleName(String messageCode)
Calculates the bundle name for the message code.

Parameters:
messageCode - the message code
Returns:
the bundle name

calculateKey

protected static String calculateKey(String messageCode)
Calculates the key for the message code.

Parameters:
messageCode - the message code
Returns:
the key


Copyright © 2008-2009 The Slim3 project. All Rights Reserved.