Package de.aristaflow.adept2.util.i18n
Class MessagesProvider
java.lang.Object
de.aristaflow.adept2.util.i18n.ResourceBundleProvider<Messages>
de.aristaflow.adept2.util.i18n.MessagesProvider
This class provides and caches resource bundles (stemming from properties) encapsulated in
Messages for 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
ConstructorsConstructorDescriptionMessagesProvider(Class<?> loadingClass) Constructs a new message provider for loading resource bundles (stemming from properties) for a specific locale for the designated class. -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 Details
-
MessagesProvider
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 Details
-
convert
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.
-