Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1)

E10653-04

oracle.jbo.common
Class StringManager

java.lang.Object
  extended by oracle.jbo.common.StringManager
Direct Known Subclasses:
StringManagerImpl, StringManagerImpl

public abstract 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

Field Summary
protected  StringManager mLast
           
static java.lang.String NULL_VALUE_BLANK
           
static java.lang.String NULL_VALUE_EMPTY
           
 
Constructor Summary
protected StringManager()
           
 
Method Summary
abstract  void appendCustomMessageBundles(java.util.ArrayList list)
           
abstract  java.util.Iterator getCustomMessageBundlesIter()
           
static java.util.Locale getDefaultLocale()
          Returns the default Locale for messages, which can be controlled with the jbo properties jbo.default.language, jbo.default.country and jbo.default.locale.variant.
static java.lang.String getGeneralExceptionString(ResourceBundleDef resBundleDef, java.lang.String key, java.lang.Exception ex)
          Constructs a message describing a fatal exception.
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, boolean useDefault)
          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 getLocalizedString(java.lang.String bundle, java.lang.String key, java.lang.String dflt, java.util.Locale locale, java.lang.Object[] values, boolean useDefault)
          Formats and localizes a message using a specified locale.
static java.lang.String getLocalizedStringFromResourceDef(ResourceBundleDef resBundleDef, java.lang.String key, java.lang.String dflt, java.util.Locale locale, java.util.Map values)
          Formats and localizes a message using a specified locale.
static java.lang.String getLocalizedStringFromResourceDef(ResourceBundleDef resourceDef, java.lang.String key, java.lang.String dflt, java.util.Locale locale, java.util.Map values, boolean useDefault)
          Formats and localizes a message using a specified locale.
static StringManager getSingleton()
           
protected  java.lang.String getString(java.util.ResourceBundle bundle, java.lang.String key, java.lang.String dflt, java.lang.Object[] values, boolean useDefault)
           
static java.lang.String getString(java.lang.String bundle, java.lang.String key, java.lang.String dflt)
          Localizes a message using the default locale.
protected  java.lang.String getString(java.lang.String bundle, java.lang.String key, java.lang.String dflt, java.util.Locale locale, java.lang.Object[] values)
           
protected  java.lang.String getString(java.lang.String bundle, java.lang.String key, java.lang.String dflt, java.util.Locale locale, java.lang.Object[] values, boolean useDefault)
           
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.
protected  java.lang.String getStringFromBundle(java.lang.String bundle, java.lang.String key, java.lang.String dflt, java.util.Locale locale, java.lang.Object[] values, boolean useDefault)
           
protected  java.lang.String getStringFromResourceDef(ResourceBundleDef resourceDef, java.lang.String key, java.lang.String dflt, java.util.Locale locale, java.util.Map values, boolean useDefault)
           
protected  java.lang.String getStringFromResourceInternal(ResourceBundleDef resourceDef, java.lang.String key, java.lang.String dflt, java.util.Locale locale, java.util.Map values, boolean useDefault)
           
protected  java.lang.String getStringInternal(java.lang.String bundle, java.lang.String key, java.lang.String dflt, java.util.Locale locale, java.lang.Object[] values, boolean useDefault)
           
static boolean isElString(java.lang.String key)
           
abstract  void removeCustomMessageBundle(java.lang.String clzName)
           
 void removeMessageBundle(java.lang.String key, java.util.Locale loc)
           
 java.lang.String resolveKeyAsEl(java.lang.String key)
           
protected  java.lang.String resolveStringWithNamedTokens(java.util.ResourceBundle bundle, java.lang.String key, java.lang.String dflt, java.util.Map values, boolean useDefault)
           
protected  java.lang.String resolveStringWithTokenFromBundle(ResourceBundleDef resourceDef, java.lang.String key, java.lang.String dflt, java.util.Locale locale, java.util.Map values, boolean useDefault)
           
protected  java.lang.String resolveStringWithTokenFromBundle(java.lang.String bundle, java.lang.String key, java.lang.String dflt, java.util.Locale locale, java.util.Map values, boolean useDefault)
           
abstract  void setCustomMessageBundles(java.util.ArrayList list)
           
static void setExtension(StringManager ext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mLast

protected StringManager mLast

NULL_VALUE_EMPTY

public static final java.lang.String NULL_VALUE_EMPTY
See Also:
Constant Field Values

NULL_VALUE_BLANK

public static final java.lang.String NULL_VALUE_BLANK
See Also:
Constant Field Values
Constructor Detail

StringManager

protected StringManager()
Method Detail

getSingleton

public static StringManager getSingleton()

setExtension

public static void setExtension(StringManager ext)

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,
                                                        boolean useDefault)
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)
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.

getLocalizedStringFromResourceDef

public static final java.lang.String getLocalizedStringFromResourceDef(ResourceBundleDef resBundleDef,
                                                                       java.lang.String key,
                                                                       java.lang.String dflt,
                                                                       java.util.Locale locale,
                                                                       java.util.Map values)
Formats and localizes a message using a specified locale.

Parameters:
resBundleDef - a ResourceBundleDef.
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 - a map of message 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,
                                                        java.lang.Object[] values,
                                                        boolean useDefault)
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.

getLocalizedStringFromResourceDef

public static final java.lang.String getLocalizedStringFromResourceDef(ResourceBundleDef resourceDef,
                                                                       java.lang.String key,
                                                                       java.lang.String dflt,
                                                                       java.util.Locale locale,
                                                                       java.util.Map values,
                                                                       boolean useDefault)
Formats and localizes a message using a specified locale.

Parameters:
resourceDef - ResourceBundleDef which creates the ResourceBundle
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 - a map of message parameters to be inserted into the message.
Returns:
a localized message, or dflt if key is not found.

getDefaultLocale

public static java.util.Locale getDefaultLocale()
Returns the default Locale for messages, which can be controlled with the jbo properties jbo.default.language, jbo.default.country and jbo.default.locale.variant. If any or all of these are set to "default" then the Java Vm's value is used for that property.

Returns:
default locale

getCustomMessageBundlesIter

public abstract java.util.Iterator getCustomMessageBundlesIter()

setCustomMessageBundles

public abstract void setCustomMessageBundles(java.util.ArrayList list)

appendCustomMessageBundles

public abstract void appendCustomMessageBundles(java.util.ArrayList list)

removeCustomMessageBundle

public abstract void removeCustomMessageBundle(java.lang.String clzName)

getString

protected final java.lang.String getString(java.lang.String bundle,
                                           java.lang.String key,
                                           java.lang.String dflt,
                                           java.util.Locale locale,
                                           java.lang.Object[] values)

getString

protected java.lang.String getString(java.lang.String bundle,
                                     java.lang.String key,
                                     java.lang.String dflt,
                                     java.util.Locale locale,
                                     java.lang.Object[] values,
                                     boolean useDefault)

getStringFromResourceDef

protected java.lang.String getStringFromResourceDef(ResourceBundleDef resourceDef,
                                                    java.lang.String key,
                                                    java.lang.String dflt,
                                                    java.util.Locale locale,
                                                    java.util.Map values,
                                                    boolean useDefault)

getStringInternal

protected final java.lang.String getStringInternal(java.lang.String bundle,
                                                   java.lang.String key,
                                                   java.lang.String dflt,
                                                   java.util.Locale locale,
                                                   java.lang.Object[] values,
                                                   boolean useDefault)

getStringFromResourceInternal

protected final java.lang.String getStringFromResourceInternal(ResourceBundleDef resourceDef,
                                                               java.lang.String key,
                                                               java.lang.String dflt,
                                                               java.util.Locale locale,
                                                               java.util.Map values,
                                                               boolean useDefault)
For internal use only. Application developers should not use this

getStringFromBundle

protected java.lang.String getStringFromBundle(java.lang.String bundle,
                                               java.lang.String key,
                                               java.lang.String dflt,
                                               java.util.Locale locale,
                                               java.lang.Object[] values,
                                               boolean useDefault)

resolveStringWithTokenFromBundle

protected java.lang.String resolveStringWithTokenFromBundle(java.lang.String bundle,
                                                            java.lang.String key,
                                                            java.lang.String dflt,
                                                            java.util.Locale locale,
                                                            java.util.Map values,
                                                            boolean useDefault)

resolveStringWithTokenFromBundle

protected java.lang.String resolveStringWithTokenFromBundle(ResourceBundleDef resourceDef,
                                                            java.lang.String key,
                                                            java.lang.String dflt,
                                                            java.util.Locale locale,
                                                            java.util.Map values,
                                                            boolean useDefault)

isElString

public static final boolean isElString(java.lang.String key)

getString

protected java.lang.String getString(java.util.ResourceBundle bundle,
                                     java.lang.String key,
                                     java.lang.String dflt,
                                     java.lang.Object[] values,
                                     boolean useDefault)

resolveKeyAsEl

public java.lang.String resolveKeyAsEl(java.lang.String key)

resolveStringWithNamedTokens

protected java.lang.String resolveStringWithNamedTokens(java.util.ResourceBundle bundle,
                                                        java.lang.String key,
                                                        java.lang.String dflt,
                                                        java.util.Map values,
                                                        boolean useDefault)

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.

getGeneralExceptionString

public static final java.lang.String getGeneralExceptionString(ResourceBundleDef resBundleDef,
                                                               java.lang.String key,
                                                               java.lang.Exception ex)
Constructs a message describing a fatal exception.

Parameters:
resBundleDef - a ResourceBundleDef.
key - a message code found in bundle.
ex - the exception to be described.
Returns:
the message.

removeMessageBundle

public void removeMessageBundle(java.lang.String key,
                                java.util.Locale loc)

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1)

E10653-04

Copyright © 1997, 2010, Oracle. All rights reserved.