|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.i18n.I18nStore
public class I18nStore
Represents the store of languages of the i18n system.
Replace theorg.nuiton.i18n.I18nLoader class from project
http://maven-site.nuiton.org/nuiton-utils
| Field Summary | |
|---|---|
protected I18nBundle[] |
bundles
le cache de bundles deja charges |
protected Locale |
defaultLocale
la locale par defaut a utiliser. |
protected I18nLanguage |
language
le language actuellement utilise |
protected Map<Locale,I18nLanguage> |
languages
le cache de languages deja charges |
protected I18nInitializer |
resolver
le resolver de bundles |
| Constructor Summary | |
|---|---|
I18nStore(Locale defaultLocale,
I18nInitializer resolver)
|
|
| Method Summary | |
|---|---|
protected I18nLanguage |
addLanguage(Locale locale)
|
protected void |
checkInit()
|
protected void |
close()
Close store and release cache ofg language. |
I18nBundleEntry[] |
getBundleEntries()
|
I18nBundleEntry[] |
getBundleEntries(Locale l)
|
I18nBundle[] |
getBundles()
|
I18nBundle[] |
getBundles(Locale l)
|
I18nLanguage |
getCurrentLanguage()
Obtain the current language setted in the store. |
Locale |
getCurrentLocale()
Obtain the current locale setted in the store. |
Locale |
getDefaultLocale()
|
I18nLanguage |
getLanguage()
Deprecated. since 2.1, will be removed in version 3.0, prefer use now the method getCurrentLanguage(). |
protected I18nLanguage |
getLanguage(Locale locale)
Recherche un object de type I18nLanguage pour la locale donnée
en paramètre dans le cache des langues chargées (languages). |
I18nLanguage[] |
getLanguages()
|
protected Map<Locale,I18nLanguage> |
getLanguagesCache()
|
Locale[] |
getLocales()
|
I18nInitializer |
getResolver()
|
protected void |
init()
|
boolean |
isEmpty()
|
protected boolean |
isInit()
|
void |
setCurrentLocale(Locale locale)
Sets the current locale for the store. |
protected void |
setLanguage(Locale locale)
Deprecated. since 2.1, will be removed in version 3.0, use now the method setCurrentLocale(Locale). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected I18nLanguage language
protected Map<Locale,I18nLanguage> languages
protected I18nBundle[] bundles
protected Locale defaultLocale
protected I18nInitializer resolver
| Constructor Detail |
|---|
public I18nStore(Locale defaultLocale,
I18nInitializer resolver)
defaultLocale - default localeresolver - resolver of bundles| Method Detail |
|---|
public I18nLanguage getCurrentLanguage()
I18n._(String, Object...)).
null if none is definedpublic Locale getCurrentLocale()
I18n._(String, Object...).
null if no current language is settedpublic void setCurrentLocale(Locale locale)
locale - the new current locale@Deprecated public I18nLanguage getLanguage()
getCurrentLanguage().
public I18nLanguage[] getLanguages()
public Locale getDefaultLocale()
public boolean isEmpty()
public Locale[] getLocales()
public I18nBundle[] getBundles()
public I18nBundle[] getBundles(Locale l)
public I18nBundleEntry[] getBundleEntries()
public I18nBundleEntry[] getBundleEntries(Locale l)
protected void init()
@Deprecated protected void setLanguage(Locale locale)
setCurrentLocale(Locale).
locale - la locale du language requisprotected void close()
protected Map<Locale,I18nLanguage> getLanguagesCache()
protected I18nLanguage getLanguage(Locale locale)
I18nLanguage pour la locale donnée
en paramètre dans le cache des langues chargées (languages).
Si un tel objet n'existe pas, alors on en crée un et on le place dans le
cache.
locale - la locale du language recherche
protected I18nLanguage addLanguage(Locale locale)
protected boolean isInit()
protected void checkInit()
public I18nInitializer getResolver()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||