
Package ca.uhn.fhir.i18n
Class MultiFileResourceBundleControl
java.lang.Object
java.util.ResourceBundle.Control
ca.uhn.fhir.i18n.MultiFileResourceBundleControl
Finds all properties files on the class path that match the given base name and merges them.
This implementation avoids the unnecessary overhead of writing to and reading from a stream.
-
Field Summary
Fields inherited from class java.util.ResourceBundle.Control
FORMAT_CLASS, FORMAT_DEFAULT, FORMAT_PROPERTIES, TTL_DONT_CACHE, TTL_NO_EXPIRATION_CONTROL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCandidateLocales
(String baseName, Locale locale) Returns a list containing only Locale.ROOT as a candidate.getFallbackLocale
(String baseName, Locale locale) Prevents fallback to the default locale if the root bundle isn't found.newBundle
(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) Methods inherited from class java.util.ResourceBundle.Control
getControl, getFormats, getNoFallbackControl, getTimeToLive, needsReload, toBundleName, toResourceName
-
Constructor Details
-
MultiFileResourceBundleControl
public MultiFileResourceBundleControl()
-
-
Method Details
-
getCandidateLocales
Returns a list containing only Locale.ROOT as a candidate. This forces the loader to look for the base bundle only (e.g., "bundle.properties").- Overrides:
getCandidateLocales
in classResourceBundle.Control
- Parameters:
baseName
- the base name of the resource bundlelocale
- the locale to load (this parameter is ignored)- Returns:
- a singleton list containing Locale.ROOT
-
getFallbackLocale
Prevents fallback to the default locale if the root bundle isn't found.- Overrides:
getFallbackLocale
in classResourceBundle.Control
- Parameters:
baseName
- the base name of the resource bundlelocale
- the locale where the search is failing- Returns:
- null to indicate no fallback should be attempted
-
newBundle
public ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) throws IOException, IllegalAccessException, InstantiationException - Overrides:
newBundle
in classResourceBundle.Control
- Throws:
IOException
IllegalAccessException
InstantiationException
-