com.scooterframework.i18n
Class Messages

java.lang.Object
  extended by com.scooterframework.i18n.Messages

public class Messages
extends java.lang.Object

Message class provides convenient methods to access i18n messages.


Constructor Summary
Messages()
           
 
Method Summary
static java.lang.String get(java.lang.String messageKey)
          Returns a message associated with the messageKey.
static java.lang.String get(java.lang.String messageKey, java.util.Locale locale)
          Returns a message associated with the messageKey in the specific locale.
static java.lang.String get(java.lang.String messageKey, java.util.Locale locale, java.lang.Object[] values)
          Returns a message associated with the messageKey and the values in a specific locale.
static java.lang.String get(java.lang.String messageKey, java.lang.Object[] values)
          Returns a message associated with the messageKey and the values.
static java.lang.String get(java.lang.String messageKey, java.lang.String language)
          Returns a message associated with the messageKey in the specific language.
static java.lang.String get(java.lang.String messageKey, java.lang.String language, java.lang.String country)
          Returns a message associated with the messageKey in the specific language of the specific country.
static java.lang.String get(java.lang.String messageKey, java.lang.String language, java.lang.String country, java.lang.String variant)
          Returns a message associated with the messageKey in the specific language of the specific country's particular variant.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Messages

public Messages()
Method Detail

get

public static java.lang.String get(java.lang.String messageKey)
Returns a message associated with the messageKey.

If there is no message associated with the messageKey in messages property files, the messageKey itself is returned.

Parameters:
messageKey - a message key in messages resource files
Returns:
a message string

get

public static java.lang.String get(java.lang.String messageKey,
                                   java.lang.String language)
Returns a message associated with the messageKey in the specific language.

If there is no message associated with the messageKey in messages property files, the messageKey itself is returned.

Parameters:
messageKey - a message key in messages resource files
language - ISO Language Code
Returns:
a message string

get

public static java.lang.String get(java.lang.String messageKey,
                                   java.lang.String language,
                                   java.lang.String country)
Returns a message associated with the messageKey in the specific language of the specific country.

If there is no message associated with the messageKey in messages property files, the messageKey itself is returned.

Parameters:
messageKey - a message key in messages resource files
language - ISO Language Code
country - ISO Country Code
Returns:
a message string

get

public static java.lang.String get(java.lang.String messageKey,
                                   java.lang.String language,
                                   java.lang.String country,
                                   java.lang.String variant)
Returns a message associated with the messageKey in the specific language of the specific country's particular variant.

If there is no message associated with the messageKey in messages property files, the messageKey itself is returned.

Parameters:
messageKey - a message key in messages resource files
language - ISO Language Code
country - ISO Country Code
variant - Variant string
Returns:
a message string

get

public static java.lang.String get(java.lang.String messageKey,
                                   java.util.Locale locale)
Returns a message associated with the messageKey in the specific locale.

If there is no message associated with the messageKey in messages property files, the messageKey itself is returned.

Parameters:
messageKey - a message key in messages resource files
locale - a specific locale object
Returns:
a message string

get

public static java.lang.String get(java.lang.String messageKey,
                                   java.lang.Object[] values)
Returns a message associated with the messageKey and the values.

If there is no message associated with the messageKey in messages property files, the messageKey itself is returned.

Parameters:
messageKey - a message key in messages resource files
values - an array of objects to be included in the message
Returns:
a message string

get

public static java.lang.String get(java.lang.String messageKey,
                                   java.util.Locale locale,
                                   java.lang.Object[] values)
Returns a message associated with the messageKey and the values in a specific locale.

If there is no message associated with the messageKey in messages property files, the messageKey itself is used as the message.

Parameters:
messageKey - a message key in messages resource files
locale - a specific locale object
values - an array of objects to be included in the message
Returns:
a message string