Class ResourceBundleHelper
- java.lang.Object
-
- com.helger.commons.text.resourcebundle.ResourceBundleHelper
-
@Immutable public final class ResourceBundleHelper extends Object
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.- Author:
- Philip Helger
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclearCache()Clear 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 StringgetString(String sBundleName, Locale aContentLocale, String sKey)static 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 Detail
-
getResourceBundle
@Nullable public static ResourceBundle getResourceBundle(@Nonnull String sBundleName, @Nonnull Locale aContentLocale)
-
getResourceBundle
@Nullable public static ResourceBundle getResourceBundle(@Nonnull String sBundleName, @Nonnull Locale aContentLocale, @Nonnull ClassLoader aClassLoader)
-
getUtf8ResourceBundle
@Nullable public static ResourceBundle getUtf8ResourceBundle(@Nonnull String sBundleName, @Nonnull Locale aContentLocale)
-
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
@Nullable public static String getString(@Nonnull String sBundleName, @Nonnull Locale aContentLocale, @Nonnull @PropertyKey String sKey)
-
getString
@Nullable public static String getString(@Nonnull String sBundleName, @Nonnull Locale aContentLocale, @Nonnull @PropertyKey String sKey, @Nonnull ClassLoader aClassLoader)
-
getUtf8String
@Nullable public static String getUtf8String(@Nonnull String sBundleName, @Nonnull Locale aContentLocale, @Nonnull @PropertyKey String sKey)
-
getUtf8String
@Nullable public static String getUtf8String(@Nonnull String sBundleName, @Nonnull Locale aContentLocale, @Nonnull @PropertyKey String sKey, @Nonnull ClassLoader aClassLoader)
-
clearCache
public static void clearCache()
Clear the complete resource bundle cache using the default class loader!
-
clearCache
public static void clearCache(@Nonnull ClassLoader aClassLoader)
Clear the complete resource bundle cache using the specified class loader!- Parameters:
aClassLoader- The class loader to be used. May not benull.
-
-