Top Description Inners Fields Constructors Methods
org.hibernate.validator.resourceloading

public Class AggregateResourceBundleLocator

extends DelegatingResourceBundleLocator
Class Inheritance
Imports
java.util.ArrayList, .Collections, .List, .Locale, .ResourceBundle, .Set, org.hibernate.validator.Incubating, org.hibernate.validator.internal.util.CollectionHelper, .Contracts, org.hibernate.validator.spi.resourceloading.ResourceBundleLocator

A ResourceBundleLocator implementation that provides access to multiple source ResourceBundles by merging them into one aggregated bundle.
Author
Gunnar Morling

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
AggregateResourceBundleLocator.AggregateBundle

Deprecated This class should not have been part of the public API and will be removed at a later stage.
A ResourceBundle whose content is aggregated from multiple source bundles.

Field Summary

Modifier and TypeField and Description
private final List<PlatformResourceBundleLocator>

Constructor Summary

AccessConstructor and Description
public
AggregateResourceBundleLocator(List<String>
A list with source bundle names. The returned bundle will contain all entries from all source bundles. In case a key occurs in multiple source bundles, the value will be taken from the first bundle containing the key.
bundleNames
)

Creates a locator that delivers a resource bundle merged from the given list of source bundles.

public
AggregateResourceBundleLocator(List<String>
A list with source bundle names. The returned bundle will contain all keys from all source bundles. In case a key occurs in multiple source bundles, the value will be taken from the first bundle containing the key.
bundleNames
,
ResourceBundleLocator
A delegate resource bundle locator. The bundle returned by this locator will be added to the aggregate bundle after all source bundles.
delegate
)

Creates a locator that delivers a resource bundle merged from the given list of source bundles.

public
AggregateResourceBundleLocator(List<String>
A list with source bundle names. The returned bundle will contain all keys from all source bundles. In case a key occurs in multiple source bundles, the value will be taken from the first bundle containing the key.
bundleNames
,
ResourceBundleLocator
A delegate resource bundle locator. The bundle returned by this locator will be added to the aggregate bundle after all source bundles.
delegate
,
ClassLoader
The classloader to use for loading the bundle.
classLoader
)

Creates a locator that delivers a resource bundle merged from the given list of source bundles.

public
AggregateResourceBundleLocator(List<String>
A list with source bundle names. The returned bundle will contain all entries from all source bundles. In case a key occurs in multiple source bundles, the value will be taken from the first bundle containing the key.
bundleNames
,
boolean
if resource bundles should be initialized when initializing the locator
preloadResourceBundles
,
Set<Locale>
The set of locales to initialize at bootstrap
localesToInitialize
)

Creates a locator that delivers a resource bundle merged from the given list of source bundles.

public
AggregateResourceBundleLocator(List<String>
A list with source bundle names. The returned bundle will contain all keys from all source bundles. In case a key occurs in multiple source bundles, the value will be taken from the first bundle containing the key.
bundleNames
,
boolean
if resource bundles should be initialized when initializing the locator
preloadResourceBundles
,
Set<Locale>
The set of locales to initialize at bootstrap
localesToInitialize
,
ResourceBundleLocator
A delegate resource bundle locator. The bundle returned by this locator will be added to the aggregate bundle after all source bundles.
delegate
)

Creates a locator that delivers a resource bundle merged from the given list of source bundles.

public
AggregateResourceBundleLocator(List<String>
A list with source bundle names. The returned bundle will contain all keys from all source bundles. In case a key occurs in multiple source bundles, the value will be taken from the first bundle containing the key.
bundleNames
,
boolean
if resource bundles should be initialized when initializing the locator
preloadResourceBundles
,
Set<Locale>
The set of locales to initialize at bootstrap
localesToInitialize
,
ResourceBundleLocator
A delegate resource bundle locator. The bundle returned by this locator will be added to the aggregate bundle after all source bundles.
delegate
,
ClassLoader
The classloader to use for loading the bundle.
classLoader
)

Creates a locator that delivers a resource bundle merged from the given list of source bundles.

Method Summary

Modifier and TypeMethod and Description
public ResourceBundle
getResourceBundle(Locale
A locale, for which a resource bundle shall be retrieved. Must not be null.
locale
)

Overrides org.hibernate.validator.resourceloading.DelegatingResourceBundleLocator.getResourceBundle.

Implements org.hibernate.validator.spi.resourceloading.ResourceBundleLocator.getResourceBundle.

Returns a resource bundle for the given locale.

Field Detail

resourceBundleLocatorsback to summary
private final List<PlatformResourceBundleLocator> resourceBundleLocators

Constructor Detail

AggregateResourceBundleLocatorback to summary
public AggregateResourceBundleLocator(List<String> bundleNames)

Creates a locator that delivers a resource bundle merged from the given list of source bundles.

Parameters
bundleNames:List<String>

A list with source bundle names. The returned bundle will contain all entries from all source bundles. In case a key occurs in multiple source bundles, the value will be taken from the first bundle containing the key.

AggregateResourceBundleLocatorback to summary
public AggregateResourceBundleLocator(List<String> bundleNames, ResourceBundleLocator delegate)

Creates a locator that delivers a resource bundle merged from the given list of source bundles.

Parameters
bundleNames:List<String>

A list with source bundle names. The returned bundle will contain all keys from all source bundles. In case a key occurs in multiple source bundles, the value will be taken from the first bundle containing the key.

delegate:ResourceBundleLocator

A delegate resource bundle locator. The bundle returned by this locator will be added to the aggregate bundle after all source bundles.

AggregateResourceBundleLocatorback to summary
public AggregateResourceBundleLocator(List<String> bundleNames, ResourceBundleLocator delegate, ClassLoader classLoader)

Creates a locator that delivers a resource bundle merged from the given list of source bundles.

Parameters
bundleNames:List<String>

A list with source bundle names. The returned bundle will contain all keys from all source bundles. In case a key occurs in multiple source bundles, the value will be taken from the first bundle containing the key.

delegate:ResourceBundleLocator

A delegate resource bundle locator. The bundle returned by this locator will be added to the aggregate bundle after all source bundles.

classLoader:ClassLoader

The classloader to use for loading the bundle.

Since
5.2
AggregateResourceBundleLocatorback to summary
public AggregateResourceBundleLocator(List<String> bundleNames, boolean preloadResourceBundles, Set<Locale> localesToInitialize)

Creates a locator that delivers a resource bundle merged from the given list of source bundles.

Parameters
bundleNames:List<String>

A list with source bundle names. The returned bundle will contain all entries from all source bundles. In case a key occurs in multiple source bundles, the value will be taken from the first bundle containing the key.

preloadResourceBundles:boolean

if resource bundles should be initialized when initializing the locator

localesToInitialize:Set<Locale>

The set of locales to initialize at bootstrap

Annotations
@Incubating
Since
6.1.1
AggregateResourceBundleLocatorback to summary
public AggregateResourceBundleLocator(List<String> bundleNames, boolean preloadResourceBundles, Set<Locale> localesToInitialize, ResourceBundleLocator delegate)

Creates a locator that delivers a resource bundle merged from the given list of source bundles.

Parameters
bundleNames:List<String>

A list with source bundle names. The returned bundle will contain all keys from all source bundles. In case a key occurs in multiple source bundles, the value will be taken from the first bundle containing the key.

preloadResourceBundles:boolean

if resource bundles should be initialized when initializing the locator

localesToInitialize:Set<Locale>

The set of locales to initialize at bootstrap

delegate:ResourceBundleLocator

A delegate resource bundle locator. The bundle returned by this locator will be added to the aggregate bundle after all source bundles.

Annotations
@Incubating
Since
6.1.1
AggregateResourceBundleLocatorback to summary
public AggregateResourceBundleLocator(List<String> bundleNames, boolean preloadResourceBundles, Set<Locale> localesToInitialize, ResourceBundleLocator delegate, ClassLoader classLoader)

Creates a locator that delivers a resource bundle merged from the given list of source bundles.

Parameters
bundleNames:List<String>

A list with source bundle names. The returned bundle will contain all keys from all source bundles. In case a key occurs in multiple source bundles, the value will be taken from the first bundle containing the key.

preloadResourceBundles:boolean

if resource bundles should be initialized when initializing the locator

localesToInitialize:Set<Locale>

The set of locales to initialize at bootstrap

delegate:ResourceBundleLocator

A delegate resource bundle locator. The bundle returned by this locator will be added to the aggregate bundle after all source bundles.

classLoader:ClassLoader

The classloader to use for loading the bundle.

Annotations
@Incubating
Since
6.1.1

Method Detail

getResourceBundleback to summary
public ResourceBundle getResourceBundle(Locale locale)

Overrides org.hibernate.validator.resourceloading.DelegatingResourceBundleLocator.getResourceBundle.

Implements org.hibernate.validator.spi.resourceloading.ResourceBundleLocator.getResourceBundle.

Doc from org.hibernate.validator.spi.resourceloading.ResourceBundleLocator.getResourceBundle.

Returns a resource bundle for the given locale.

Parameters
locale:Locale

A locale, for which a resource bundle shall be retrieved. Must not be null.

Returns:ResourceBundle

A resource bundle for the given locale. May be null, if no such bundle exists.

Annotations
@Override
org.hibernate.validator.resourceloading back to summary

public Class AggregateResourceBundleLocator.AggregateBundle

extends AggregateResourceBundle
Class Inheritance
Annotations
@Deprecated

Deprecated

This class should not have been part of the public API and will be removed at a later stage.

A ResourceBundle whose content is aggregated from multiple source bundles.
Author
Gunnar Morling

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from org.hibernate.validator.resourceloading.AggregateResourceBundle:
getKeyshandleGetObjecthandleKeySet

Constructor Detail

AggregateBundleback to summary
public AggregateBundle(List<ResourceBundle> bundles)