public class I18nBundle extends Object implements Iterable<I18nBundleEntry>
bundlePrefix is the equals order property.
The property entries contains all entries defined for this bundle.
The method getEntries(Locale) filter entries for a given locale,
including scope inclusive property.
The method getEntries(I18nBundleScope) filter entries for a given
scope, with no inclusive logi.
Thoses filter methods return result in the order defines in I18nBundleEntry, e.g
XXX.properties XXX-fr.properties XXX-fr_FR.propertiesIn that way, we can load resource in the good order : load before more general scope to more specialized.
I18nBundleScope,
I18nBundleEntry| Modifier and Type | Field and Description |
|---|---|
protected String |
bundlePrefix
le nom du bundle encapsulé (correspond au prefix de l'url de chargement)
|
protected List<I18nBundleEntry> |
entries
les entrés du bundle
|
| Constructor and Description |
|---|
I18nBundle(String bundlePrefix) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addEntry(I18nBundleEntry entry) |
String |
getBundlePrefix() |
protected List<I18nBundleEntry> |
getEntries() |
I18nBundleEntry[] |
getEntries(I18nBundleScope scope)
Obtain the entries for a given
scope with no incluvie
logic. |
I18nBundleEntry[] |
getEntries(Locale locale)
Obtain the entries for a given locale, with a inclusive scope search.
|
Iterator<I18nBundleEntry> |
iterator() |
protected boolean |
matchLocale(Locale locale) |
int |
size() |
String |
toString() |
protected List<I18nBundleEntry> entries
protected final String bundlePrefix
public I18nBundle(String bundlePrefix)
public String getBundlePrefix()
public I18nBundleEntry[] getEntries(Locale locale)
I18nBundleEntry order.locale - the required localepublic I18nBundleEntry[] getEntries(I18nBundleScope scope)
scope with no incluvie
logic.
The order of result respect I18nBundleEntry order.scope - the required scopepublic int size()
protected List<I18nBundleEntry> getEntries()
protected boolean matchLocale(Locale locale)
public boolean addEntry(I18nBundleEntry entry)
public Iterator<I18nBundleEntry> iterator()
iterator in interface Iterable<I18nBundleEntry>Copyright © 2004–2013 CodeLutin. All rights reserved.