Class ResourceBundleHelper
java.lang.Object
com.helger.commons.text.resourcebundle.ResourceBundleHelper
Resource bundle utility methods.
Note: the UTF-8 resource bundles are only needed when using Java 1.8 or below since the default was ISO-8859-1. Since Java 9 all ResurceBundles are UTF-8 by default.
Note: the UTF-8 resource bundles are only needed when using Java 1.8 or below since the default was ISO-8859-1. Since Java 9 all ResurceBundles are UTF-8 by default.
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidClear the complete resource bundle cache using the default class loader!static voidclearCache(ClassLoader aClassLoader) Clear the complete resource bundle cache using the specified class loader!static ResourceBundlegetResourceBundle(String sBundleName, Locale aContentLocale) static ResourceBundlegetResourceBundle(String sBundleName, Locale aContentLocale, ClassLoader aClassLoader) static Stringstatic StringgetString(String sBundleName, Locale aContentLocale, String sKey, ClassLoader aClassLoader) static StringgetString(ResourceBundle aResourceBundle, String sKey) static ResourceBundlegetUtf8ResourceBundle(String sBundleName, Locale aContentLocale) static ResourceBundlegetUtf8ResourceBundle(String sBundleName, Locale aContentLocale, ClassLoader aClassLoader) static StringgetUtf8String(String sBundleName, Locale aContentLocale, String sKey) static StringgetUtf8String(String sBundleName, Locale aContentLocale, String sKey, ClassLoader aClassLoader)
-
Method Details
-
getResourceBundle
-
getResourceBundle
@Nullable public static ResourceBundle getResourceBundle(@Nonnull String sBundleName, @Nonnull Locale aContentLocale, @Nonnull ClassLoader aClassLoader) -
getUtf8ResourceBundle
-
getUtf8ResourceBundle
@Nullable public static ResourceBundle getUtf8ResourceBundle(@Nonnull String sBundleName, @Nonnull Locale aContentLocale, @Nonnull ClassLoader aClassLoader) -
getString
@Nullable public static String getString(@Nullable ResourceBundle aResourceBundle, @Nonnull @PropertyKey String sKey) -
getString
-
getString
-
getUtf8String
-
getUtf8String
-
clearCache
public static void clearCache()Clear the complete resource bundle cache using the default class loader! -
clearCache
Clear the complete resource bundle cache using the specified class loader!- Parameters:
aClassLoader- The class loader to be used. May not benull.
-