ResourceBundle.loadBundle(String, Local, ClassLoader).
This locator is also able to load all property files of a given name (in case there are multiple with the same
name on the classpath) and aggregates them into a ResourceBundle.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private final String | |
| private final ClassLoader | |
| private static final Log | |
| private final Map | |
| private static final boolean |
| Access | Constructor and Description |
|---|---|
| public | PlatformResourceBundleLocator(String
the name of the bundle to load bundleName)Creates a new |
| public | PlatformResourceBundleLocator(String
the name of the bundle to load bundleName, ClassLoader the classloader to be used for loading the bundle. If classLoader)null, the current thread context
classloader and finally Hibernate Validator's own classloader will be used for loading the specified
bundle.Creates a new |
| public | PlatformResourceBundleLocator(String
the name of the bundle to load bundleName, ClassLoader the classloader to be used for loading the bundle. If classLoader, boolean null, the current thread context
classloader and finally Hibernate Validator's own classloader will be used for loading the specified
bundle.Whether or not all resource bundles of a given name should be loaded and potentially merged. aggregate)Creates a new |
| public | PlatformResourceBundleLocator(String
the name of the bundle to load bundleName, Set<Locale> the set of locales to initialize at bootstrap localesToInitialize)Creates a new |
| public | PlatformResourceBundleLocator(String
the name of the bundle to load bundleName, Set<Locale> the set of locales to initialize at bootstrap localesToInitialize, ClassLoader the classloader to be used for loading the bundle. If classLoader)null, the current thread context
classloader and finally Hibernate Validator's own classloader will be used for loading the specified
bundle.Creates a new |
| public | PlatformResourceBundleLocator(String
the name of the bundle to load bundleName, Set<Locale> the set of locales to initialize at bootstrap localesToInitialize, ClassLoader the classloader to be used for loading the bundle. If classLoader, boolean null, the current thread context
classloader and finally Hibernate Validator's own classloader will be used for loading the specified
bundle.Whether or not all resource bundles of a given name should be loaded and potentially merged. aggregate)Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | determineAvailabilityOfResourceBundleControl()
Check whether ResourceBundle.Control is available, which is needed for bundle aggregation. |
| private ResourceBundle | |
| public ResourceBundle | Returns: the resource bundle ornull if none is found.The locale of the bundle to load. locale)Implements org. |
| private ResourceBundle | |
| private static <T> T | run(PrivilegedAction<T> action)
Runs the given privileged action, using a privileged block if required. |
| aggregate | back to summary |
|---|---|
| private final boolean aggregate | |
| bundleName | back to summary |
|---|---|
| private final String bundleName | |
| classLoader | back to summary |
|---|---|
| private final ClassLoader classLoader | |
| LOG | back to summary |
|---|---|
| private static final Log LOG | |
| preloadedResourceBundles | back to summary |
|---|---|
| private final Map<Locale, ResourceBundle> preloadedResourceBundles
| |
| RESOURCE_BUNDLE_CONTROL_INSTANTIABLE | back to summary |
|---|---|
| private static final boolean RESOURCE_BUNDLE_CONTROL_INSTANTIABLE | |
| PlatformResourceBundleLocator | back to summary |
|---|---|
| public PlatformResourceBundleLocator(String bundleName) Creates a new
| |
| PlatformResourceBundleLocator | back to summary |
|---|---|
| public PlatformResourceBundleLocator(String bundleName, ClassLoader classLoader) Creates a new
| |
| PlatformResourceBundleLocator | back to summary |
|---|---|
| public PlatformResourceBundleLocator(String bundleName, ClassLoader classLoader, boolean aggregate) Creates a new
| |
| PlatformResourceBundleLocator | back to summary |
|---|---|
| public PlatformResourceBundleLocator(String bundleName, Set<Locale> localesToInitialize) Creates a new
| |
| PlatformResourceBundleLocator | back to summary |
|---|---|
| public PlatformResourceBundleLocator(String bundleName, Set<Locale> localesToInitialize, ClassLoader classLoader) Creates a new
| |
| PlatformResourceBundleLocator | back to summary |
|---|---|
| public PlatformResourceBundleLocator(String bundleName, Set<Locale> localesToInitialize, ClassLoader classLoader, boolean aggregate) Creates a new
| |
| determineAvailabilityOfResourceBundleControl | back to summary |
|---|---|
| private static boolean determineAvailabilityOfResourceBundleControl() Check whether ResourceBundle.Control is available, which is needed for bundle aggregation. If not, we'll skip resource aggregation. It is *not* available
| |
| doGetResourceBundle | back to summary |
|---|---|
| private ResourceBundle doGetResourceBundle(Locale locale) | |
| getResourceBundle | back to summary |
|---|---|
| public ResourceBundle getResourceBundle(Locale locale) Implements org. Search current thread classloader for the resource bundle. If not found, search validator (this) classloader.
| |
| loadBundle | back to summary |
|---|---|
| private ResourceBundle loadBundle(ClassLoader classLoader, Locale locale, String message) | |
| run | back to summary |
|---|---|
| private static <T> T run(PrivilegedAction<T> action) Runs the given privileged action, using a privileged block if required. Note This must never be changed into a publicly available method to avoid execution of arbitrary privileged actions within HV's protection domain.
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final ResourceBundle. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static List | |
| public ResourceBundle | newBundle(String
the base bundle name of the resource bundle, a fully
qualified class name baseName, Locale the locale for which the resource bundle should be
instantiated locale, String the resource bundle format to be loaded format, ClassLoader the loader, boolean ClassLoader to use to load the bundlethe flag to indicate bundle reloading; reload)true
if reloading an expired resource bundle,
false otherwiseOverrides java. |
| CONTROL | back to summary |
|---|---|
| private static final ResourceBundle. | |
| AggregateResourceBundleControl | back to summary |
|---|---|
| private AggregateResourceBundleControl() | |
| load | back to summary |
|---|---|
| private static List | |
| newBundle | back to summary |
|---|---|
| public ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) throws IllegalAccessException, InstantiationException, IOException Overrides java. Doc from java. Instantiates a resource bundle for the given bundle name of the
given format and locale, using the given class loader if
necessary. This method returns If the
| |