Package de.aristaflow.adept2.util.i18n
Class MessagesProvider
- java.lang.Object
-
- de.aristaflow.adept2.util.i18n.ResourceBundleProvider<Messages>
-
- de.aristaflow.adept2.util.i18n.MessagesProvider
-
public class MessagesProvider extends ResourceBundleProvider<Messages>
This class provides and caches resource bundles (stemming from properties) encapsulated inMessagesfor various locales. This is coupled to a loading class providing the base name and the classloader (and usually also the key constants).
-
-
Field Summary
-
Fields inherited from class de.aristaflow.adept2.util.i18n.ResourceBundleProvider
baseName, cache, classLoader, control
-
-
Constructor Summary
Constructors Constructor Description MessagesProvider(Class<?> loadingClass)Constructs a new message provider for loading resource bundles (stemming from properties) for a specific locale for the designated class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Messagesconvert(Locale reqLocale, ResourceBundle bundle)Converts the designated resource bundle to the corresponding localising object.-
Methods inherited from class de.aristaflow.adept2.util.i18n.ResourceBundleProvider
apply, forLocale
-
-
-
-
Constructor Detail
-
MessagesProvider
public MessagesProvider(Class<?> loadingClass)
Constructs a new message provider for loading resource bundles (stemming from properties) for a specific locale for the designated class.- Parameters:
loadingClass- The class with which to load the resource bundle.
-
-
Method Detail
-
convert
protected Messages convert(Locale reqLocale, ResourceBundle bundle)
Description copied from class:ResourceBundleProviderConverts the designated resource bundle to the corresponding localising object.- Specified by:
convertin classResourceBundleProvider<Messages>- Parameters:
reqLocale- The requested locale. This may differ from the locale of the resource bundle.bundle- The resource bundle for which to get the corresponding localising object.- Returns:
- The localising object for the designated resource bundle.
-
-