Business Components

oracle.jbo.common
Class StringManager

java.lang.Object
  |
  +--oracle.jbo.common.StringManager

public class StringManager
extends java.lang.Object

Provides methods for managing localizable messages.

This class provides static methods for obtaining unformatted messages from a resource and performing formatting.

This class ia a wrapper for the standard Java ResourceBundle and MessageFormat classes.

This class traps exceptions that may occur while constructing messages, and describes the failure in the message that is returned.

Since:
Jdeveloper 3.0

Constructor Summary
StringManager()
           
 
Method Summary
static java.lang.String getGeneralExceptionString(java.lang.String bundle, java.lang.String key, java.lang.Exception ex)
          Constructs a message describing a fatal exception.
static java.lang.String getLocalizedString(java.lang.String bundle, java.lang.String key, java.lang.String dflt, java.util.Locale locale)
          Localizes a message using a specified locale.
static java.lang.String getLocalizedString(java.lang.String bundle, java.lang.String key, java.lang.String dflt, java.util.Locale locale, java.lang.Object[] values)
          Formats and localizes a message using a specified locale.
static java.lang.String getString(java.lang.String bundle, java.lang.String key, java.lang.String dflt)
          Localizes a message using the default locale.
static java.lang.String getString(java.lang.String bundle, java.lang.String key, java.lang.String dflt, java.lang.Object[] values)
          Formats and localizes a message using the default locale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringManager

public StringManager()
Method Detail

getString

public static final java.lang.String getString(java.lang.String bundle,
                                               java.lang.String key,
                                               java.lang.String dflt)
Localizes a message using the default locale.

Parameters:
bundle - the name of a ResourceBundle class.
key - a message code found in bundle.
dflt - the default value; returned if the message named by key is not found.
Returns:
a localized message, or dflt if key is not found.

getString

public static final java.lang.String getString(java.lang.String bundle,
                                               java.lang.String key,
                                               java.lang.String dflt,
                                               java.lang.Object[] values)
Formats and localizes a message using the default locale.

Parameters:
bundle - the name of a ResourceBundle class.
key - a message code found in bundle.
dflt - the default value; returned if the message named by key is not found.
values - an array of parameters to be inserted into the message.
Returns:
a localized message, or dflt if key is not found.

getLocalizedString

public static final java.lang.String getLocalizedString(java.lang.String bundle,
                                                        java.lang.String key,
                                                        java.lang.String dflt,
                                                        java.util.Locale locale)
Localizes a message using a specified locale.

Parameters:
bundle - the name of a ResourceBundle class.
key - a message code found in bundle.
dflt - the default value; returned if the message named by key is not found.
locale - the target language for the message.
Returns:
a localized message, or dflt if key is not found.

getLocalizedString

public static final java.lang.String getLocalizedString(java.lang.String bundle,
                                                        java.lang.String key,
                                                        java.lang.String dflt,
                                                        java.util.Locale locale,
                                                        java.lang.Object[] values)
Formats and localizes a message using a specified locale.

Parameters:
bundle - the name of a ResourceBundle class.
key - a message code found in bundle.
dflt - the default value; returned if the message named by key is not found.
locale - the target language for the message.
values - an array of message parameters to be inserted into the message.
Returns:
a localized message, or dflt if key is not found.

getGeneralExceptionString

public static final java.lang.String getGeneralExceptionString(java.lang.String bundle,
                                                               java.lang.String key,
                                                               java.lang.Exception ex)
Constructs a message describing a fatal exception.
Parameters:
bundle - the name of a ResourceBundle class.
key - a message code found in bundle.
ex - the exception to be described.
Returns:
the message.

Business Components