public class StringResourceBundleSupport extends GenericResourceBundleSupport
| Modifier and Type | Field and Description |
|---|---|
static boolean |
NO_TRIM_PACKAGE_NAME
default values for trimming the package name when getting a String safely
|
static boolean |
TRIM_PACKAGE_NAME |
LOCAL_COUNTRY_CMDARG, LOCAL_LANGUAGE_CMDARG| Constructor and Description |
|---|
StringResourceBundleSupport(String baseName,
ClassLoader classloader)
create a new instance for the basename and classloader
|
| Modifier and Type | Method and Description |
|---|---|
char |
getChar(String key)
Look up the specified key in the receiver's resource bundle.
|
Character |
getCharacter(String key)
Look up the specified key in the receiver's resource bundle.
|
MessageFormat |
getFormat(String key)
Look up the specified key in the receiver's resource bundle.
|
String |
getFormattedMessage(String key,
Object[] args)
Look up a key and use a MessageFormat to format it, plugging in
arguments.
|
String |
getString(String key)
Look up the specified key in the receiver's resource bundle.
|
String |
getStringSafely(String key)
Look up the specified key in the receiver's resource bundle.
|
String |
getStringSafely(String key,
boolean trimPackageName)
Look up the specified key in the receiver's resource bundle.
|
URL |
getURL(String key)
Look up the specified key in the receiver's resource bundle.
|
URL |
getURLByValue(String value)
Look up the specified file as passed-in return an URL for that file.
|
getObjectpublic static final boolean NO_TRIM_PACKAGE_NAME
public static final boolean TRIM_PACKAGE_NAME
public StringResourceBundleSupport(String baseName, ClassLoader classloader) throws MissingResourceException
baseName - (e.g. : "com.lwm.core.ui.mptable.i18n.UiBundle")classloader - parameterMissingResourceException - on errorpublic char getChar(String key) throws ChainedException
key - parameterChainedException - on errorpublic Character getCharacter(String key) throws ChainedException
key - parameterChainedException - on errorpublic MessageFormat getFormat(String key)
key - parameterMessageFormatpublic String getFormattedMessage(String key, Object[] args)
key - Key to look up in resource bundleargs - Array of argumentspublic String getString(String key)
key - parameterpublic String getStringSafely(String key)
key - parameterpublic String getStringSafely(String key, boolean trimPackageName)
key - the lookup keytrimPackageName - decide if we trim the package name if the key does not exist
true will trim it, false won'tpublic URL getURL(String key) throws ChainedException
key - parameterChainedException - on errorClass.getResource(java.lang.String)public URL getURLByValue(String value) throws ChainedException
value - parameterChainedException - on errorClass.getResource(java.lang.String)Copyright 2004-2021 Solace Corporation. All rights reserved.