public enum I18nBundleScope extends Enum<I18nBundleScope>
GENERAL : for a bundle entry
with no locale specialized information, eg : bundle.propertiesLANGUAGE : for a bundle entry with language locale specialized
information, eg : bundle-en.propertiesFULL :
for a bundle entry with full locale specialized information, eg :
bundle-en_GB.propertiesGENERAL < LANGUAGE < FULL
Scopes are inclusives, in a search of entries, eg the search of
en_GB will include en scope...
The #patternAll is the searching pattern of bundle of the scope.
The method getMatcher(String) obtain from the #patternAll
the matcher for a bundle path.
The method getLocale(Matcher) obtain from the #patternAll
matched in a bundle path, the corresponding locale.
The class offer also a static method valueOf(Locale) to obtain the
scope of a locale.| Enum Constant and Description |
|---|
FULL
full scope : language + country
|
GENERAL
default scope (with no language, nor country information)
|
LANGUAGE
language scope (no country information)
|
| Modifier and Type | Method and Description |
|---|---|
String |
getBundlePrefix(Matcher matcher) |
abstract Locale |
getLocale(Matcher matcher)
get the locale for a given matcher.
|
Matcher |
getMatcher(String path)
get a matcher fro the given path for this scope
|
static I18nBundleScope |
valueOf(Locale locale)
Obtain the scope of a given
locale. |
static I18nBundleScope |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static I18nBundleScope[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final I18nBundleScope GENERAL
public static final I18nBundleScope LANGUAGE
public static final I18nBundleScope FULL
public static I18nBundleScope[] values()
for (I18nBundleScope c : I18nBundleScope.values()) System.out.println(c);
public static I18nBundleScope valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static I18nBundleScope valueOf(Locale locale)
locale.
The given locale can be null, which means GENERAL
scope.locale - given locale to convertpublic Matcher getMatcher(String path)
path - the path to treatepublic abstract Locale getLocale(Matcher matcher)
matcher - the scope matcher to useCopyright © 2004–2016 CodeLutin. All rights reserved.