Rule Execution Server API

ilog.rules.util.prefs
Class IlrMessages

java.lang.Object
  extended by ilog.rules.util.prefs.IlrPropertyManager
      extended by ilog.rules.util.prefs.IlrMessages

public class IlrMessages
extends IlrPropertyManager

A class to retrieve localized messages.


Method Summary
static String format(String key, Object arg0)
           
static String format(String key, Object[] args)
           
static String format(String key, Object arg0, Object arg1)
           
static String format(String key, Object arg0, Object arg1, Object arg2)
           
protected  String getBaseClassName()
          Returns the base class name for the messages, that is "messages".
static char getChar(IlrPropertyBundle bundle, String key, char defaultValue)
          Returns the char associated to the key key or the given default value if the key is not found.
static char getChar(String key, char defaultValue)
          Returns the char associated to the key key or the given default value if the key is not found.
static int getInt(String key, int defaultValue)
          Returns the integer associated to the specified key, or the defaultValue if the key is not found or if the key can not be parsed as Integer.
static String getMessage(IlrPropertyBundle bundle, String key)
          Returns the string associated to the specified key or the key itself if the key is not found.
static String getMessage(IlrPropertyBundle bundle, String key, Object[] args)
          Returns the formatted string associated to the specified key or the key itself if the key is not found.
static String getMessage(IlrPropertyBundle bundle, String key, String defaultValue)
          Returns the string associated to the specified key or the given default value if the key is not found.
static String getMessage(IlrPropertyBundle bundle, String key, String defaultValue, Object[] args)
          Returns the formatted string associated to the specified key, or the defaultValue if the key is not found.
static String getMessage(String key)
          Returns the string associated to the specified key or the key itself if the key is not found.
static String getMessage(String key, Locale locale)
          Returns the string associated to the specified key or the key itself if the key is not found.
static String getMessage(String key, Object[] args)
          Returns the formatted string associated to the specified key or the key itself if the key is not found.
static String getMessage(String key, Object[] args, Locale locale)
          Returns the formatted string associated to the specified key or the key itself if the key is not found.
static String getMessage(String key, String defaultValue)
          Returns the string associated to the specified key or the given default value if the key is not found.
static String getMessage(String key, String defaultValue, Locale locale)
          Returns the string associated to the specified key or the given default value if the key is not found.
static IlrMessages getMessages()
          Return the only instance of IlrMessages.
 
Methods inherited from class ilog.rules.util.prefs.IlrPropertyManager
addPrefix, addSuffix, findPropertyBundle, findPropertyBundle, getClassLoader, getLocale, getMaximumDepth, getPrefixes, getPropertyBundle, getPropertyBundle, getSuffixes, getValue, getValue, getValue, getValue, insertPrefixAt, insertSuffixAt, removePrefixAt, removeSuffixAt, setClassLoader, setLocale, setMaximumDepth, setPrefixes, setSuffixes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMessages

public static IlrMessages getMessages()
Return the only instance of IlrMessages. The message manager organizes the messages as a hierarchy of property bundles.

See Also:
IlrPropertyManager

getBaseClassName

protected String getBaseClassName()
Returns the base class name for the messages, that is "messages".

Specified by:
getBaseClassName in class IlrPropertyManager

getChar

public static char getChar(String key,
                           char defaultValue)
Returns the char associated to the key key or the given default value if the key is not found.

Parameters:
key - The key to search.
defaultValue - The default value.

getChar

public static char getChar(IlrPropertyBundle bundle,
                           String key,
                           char defaultValue)
Returns the char associated to the key key or the given default value if the key is not found. The search is limited to the specified property bundle.

Parameters:
bundle - The bundle to look into.
key - The key to search.
defaultValue - The default value.

getMessage

public static String getMessage(String key)
Returns the string associated to the specified key or the key itself if the key is not found.

Parameters:
key - The key to search.

getMessage

public static String getMessage(String key,
                                Locale locale)
Returns the string associated to the specified key or the key itself if the key is not found.

Parameters:
key - The key to search.
locale - The locale.

getMessage

public static String getMessage(IlrPropertyBundle bundle,
                                String key)
Returns the string associated to the specified key or the key itself if the key is not found. The search is limited to the specified property bundle.

Parameters:
bundle - The bundle to look into.
key - The key to search.

getMessage

public static String getMessage(String key,
                                String defaultValue)
Returns the string associated to the specified key or the given default value if the key is not found.

Parameters:
key - The key to search.
defaultValue - The default value.

getMessage

public static String getMessage(String key,
                                String defaultValue,
                                Locale locale)
Returns the string associated to the specified key or the given default value if the key is not found.

Parameters:
key - The key to search.
defaultValue - The default value.
locale - The locale.

getMessage

public static String getMessage(IlrPropertyBundle bundle,
                                String key,
                                String defaultValue)
Returns the string associated to the specified key or the given default value if the key is not found. The search is limited to the specified property bundle.

Parameters:
bundle - The bundle to look into.
key - The key to search.
defaultValue - The default value.

getMessage

public static String getMessage(String key,
                                Object[] args)
Returns the formatted string associated to the specified key or the key itself if the key is not found. If the key is found the associated String is is formatted using the java.text.MessageFormat.format(String pattern, Object[] arguments) method.

Parameters:
key - The key to search.
args - An array of objects to be formatted and substituted.

getMessage

public static String getMessage(String key,
                                Object[] args,
                                Locale locale)
Returns the formatted string associated to the specified key or the key itself if the key is not found. If the key is found the associated String is is formatted using the java.text.MessageFormat.format(String pattern, Object[] arguments) method.

Parameters:
key - The key to search.
args - An array of objects to be formatted and substituted.
locale - The locale.

getMessage

public static String getMessage(IlrPropertyBundle bundle,
                                String key,
                                Object[] args)
Returns the formatted string associated to the specified key or the key itself if the key is not found. The search is limited to the specified property bundle.

Parameters:
bundle - The bundle to look into.
key - The key to search.
args - An array of objects to be formatted and substituted.

getMessage

public static String getMessage(IlrPropertyBundle bundle,
                                String key,
                                String defaultValue,
                                Object[] args)
Returns the formatted string associated to the specified key, or the defaultValue if the key is not found. The search is limited to the specified property bundle.

Parameters:
bundle - The bundle to look into.
key - The key to search.
defaultValue - The value to return if the key is not found.
args - An array of objects to be formatted and substituted.

getInt

public static int getInt(String key,
                         int defaultValue)
Returns the integer associated to the specified key, or the defaultValue if the key is not found or if the key can not be parsed as Integer.

Parameters:
key - The key to search.
defaultValue - The value to return if the key is not found.

format

public static String format(String key,
                            Object arg0)

format

public static String format(String key,
                            Object arg0,
                            Object arg1)

format

public static String format(String key,
                            Object arg0,
                            Object arg1,
                            Object arg2)

format

public static String format(String key,
                            Object[] args)

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013