public class ResourceBundleUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
KEY_PREFIX |
static String |
PACKAGE_RESOURCE_BUNDLE_BASE_NAME |
Modifier and Type | Method and Description |
---|---|
static ResourceBundle |
getClassResourceBundle(Class<?> type) |
static String |
getClassResourceStringPrefixed(Class<?> type,
String resourceKey) |
static ResourceBundle |
getPackageResourceBundle(Class<?> type) |
static String |
getPackageResourceStringPrefixed(Class<?> type,
String resourceKey) |
static String |
getPackageResourceStringPrefixed(String aPackage,
String resourceKey,
ClassLoader classLoader)
Gets a resource string from the package-
ResourceBundle (Bundle.properties), if the resourceKey is
prefixed with '%', else the resoure key itself gets returned. |
static ResourceBundle |
getResourceBundle(Class<?> type,
String resourceBundleBaseName,
String resourceKey) |
static String |
getResourceStringPrefixed(String resourceKey,
ResourceBundle resourceBundle) |
public static final String PACKAGE_RESOURCE_BUNDLE_BASE_NAME
public static final String KEY_PREFIX
public static ResourceBundle getResourceBundle(Class<?> type, String resourceBundleBaseName, String resourceKey)
public static ResourceBundle getClassResourceBundle(Class<?> type)
public static String getClassResourceStringPrefixed(Class<?> type, String resourceKey)
public static ResourceBundle getPackageResourceBundle(Class<?> type)
public static String getPackageResourceStringPrefixed(Class<?> type, String resourceKey)
public static String getPackageResourceStringPrefixed(String aPackage, String resourceKey, ClassLoader classLoader)
ResourceBundle
(Bundle.properties), if the resourceKey
is
prefixed with '%', else the resoure key itself gets returned.aPackage
- resourceKey
- classLoader
- public static String getResourceStringPrefixed(String resourceKey, ResourceBundle resourceBundle)
resourceKey
- resourceBundle
- NullPointerException
- if the key is nullMissingResourceException
- if no value for the specified key can be foundClassCastException
- if the value is not a String
Copyright © 2012–2015 Drombler. All rights reserved.