|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.core.util.ResourceUtils
public class ResourceUtils
Utilities for using resource bundles.
The getBundle() calls cache the requested bundles hashed off of the Locale and the bundle basename. This will provide a speed-up over ResourceBundle.getBundle() for components that are doing many getBundle() calls, turning a series of String concatenations into two Hashtable look-ups.
The getMsgResource() calls prepend the resource string with an identifying string consisting of the bundle name and the resource look-up key. When messages are localized, it is useful to be able to identify where they came from.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
static boolean |
useBundlePrefix
|
Constructor Summary | |
---|---|
ResourceUtils()
Empty constructor. |
Method Summary | |
---|---|
static java.util.ResourceBundle |
getBundle(java.lang.String pBaseName)
Returns the requested ResourceBundle. |
static java.util.ResourceBundle |
getBundle(java.lang.String pBaseName,
java.util.Locale pLocale)
Returns the requested ResourceBundle for the specified Locale. |
static java.lang.String |
getMsgResource(java.lang.String pLookupKey,
java.lang.String pBundleName,
java.util.ResourceBundle pBundle)
Fetches the message resource from the given bundle and pre-pends the resource ID string to the message. |
static java.lang.String |
getMsgResource(java.lang.String pLookupKey,
java.lang.String pBundleName,
java.util.ResourceBundle pBundle,
java.lang.Object pMsgArg)
Fetches the message resource from the given bundle and pre-pends the resource ID string to the message. |
static java.lang.String |
getMsgResource(java.lang.String pLookupKey,
java.lang.String pBundleName,
java.util.ResourceBundle pBundle,
java.lang.Object[] pMsgArgs)
Fetches the message resource from the given bundle and pre-pends the resource ID string to the message. |
static java.lang.String |
getMsgResource(java.lang.String pLookupKey,
java.lang.String pBundleName,
java.util.ResourceBundle pBundle,
java.lang.Object pMsgArg1,
java.lang.Object pMsgArg2)
Fetches the message resource from the given bundle and pre-pends the resource ID string to the message. |
static java.lang.String |
getUserMsgResource(java.lang.String pLookupKey,
java.lang.String pBundleName,
java.util.ResourceBundle pBundle)
Fetches the message resource from the given bundle without prepending the resource ID string to the message. |
static java.lang.String |
getUserMsgResource(java.lang.String pLookupKey,
java.lang.String pBundleName,
java.util.ResourceBundle pBundle,
java.lang.Object[] pMsgArgs)
Fetches the message resource from the given bundle without prepending the resource ID string to the message. |
static void |
setUseBundlePrefix(boolean pUseBundlePrefix)
Should we display messages using the bundle name and resource key as a prefix or just display the messages? |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
public static boolean useBundlePrefix
Constructor Detail |
---|
public ResourceUtils()
Method Detail |
---|
public static java.util.ResourceBundle getBundle(java.lang.String pBaseName) throws java.util.MissingResourceException
java.util.MissingResourceException
public static java.util.ResourceBundle getBundle(java.lang.String pBaseName, java.util.Locale pLocale) throws java.util.MissingResourceException
java.util.MissingResourceException
public static java.lang.String getMsgResource(java.lang.String pLookupKey, java.lang.String pBundleName, java.util.ResourceBundle pBundle)
public static java.lang.String getMsgResource(java.lang.String pLookupKey, java.lang.String pBundleName, java.util.ResourceBundle pBundle, java.lang.Object[] pMsgArgs)
public static java.lang.String getMsgResource(java.lang.String pLookupKey, java.lang.String pBundleName, java.util.ResourceBundle pBundle, java.lang.Object pMsgArg)
public static java.lang.String getMsgResource(java.lang.String pLookupKey, java.lang.String pBundleName, java.util.ResourceBundle pBundle, java.lang.Object pMsgArg1, java.lang.Object pMsgArg2)
public static void setUseBundlePrefix(boolean pUseBundlePrefix)
public static java.lang.String getUserMsgResource(java.lang.String pLookupKey, java.lang.String pBundleName, java.util.ResourceBundle pBundle)
public static java.lang.String getUserMsgResource(java.lang.String pLookupKey, java.lang.String pBundleName, java.util.ResourceBundle pBundle, java.lang.Object[] pMsgArgs)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |