|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.i18n.bundle.I18nBundle
public class I18nBundle
Class to represent a i18n Bundle.
A bundle is defined by a resource prefix (eg /tmp/bundle.properties), and a list of locale implemented entries. The propertybundlePrefix 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| Field Summary | |
|---|---|
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 Summary | |
|---|---|
I18nBundle(String bundlePrefix)
|
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected List<I18nBundleEntry> entries
protected final String bundlePrefix
| Constructor Detail |
|---|
public I18nBundle(String bundlePrefix)
| Method Detail |
|---|
public String getBundlePrefix()
public I18nBundleEntry[] getEntries(Locale locale)
I18nBundleEntry order.
locale - the required locale
public I18nBundleEntry[] getEntries(I18nBundleScope scope)
scope with no incluvie
logic.
The order of result respect I18nBundleEntry order.
scope - the required scope
public int size()
public String toString()
toString in class Objectprotected List<I18nBundleEntry> getEntries()
protected boolean matchLocale(Locale locale)
public boolean addEntry(I18nBundleEntry entry)
public Iterator<I18nBundleEntry> iterator()
iterator in interface Iterable<I18nBundleEntry>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||