|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.i18n.bundle.I18nBundleEntry
public class I18nBundleEntry
A class to represent an entry in a bundle.
The object matches exactly one resource file in a given scope. The object has three properties :path : the path to
resource file where to find transaltion for the entry. locale :
the locale of the entry path.
This object is Comparable, the order relation is defined like this :
scope, in the scope order (see I18nBundleScope), locale string
representation.
I18nBundleScope| Field Summary | |
|---|---|
protected Locale |
locale
local of the entry, can be null if general scope |
protected URL |
path
path to resource file |
protected I18nBundleScope |
scope
scope of the entry |
| Constructor Summary | |
|---|---|
I18nBundleEntry(URL path,
Locale locale,
I18nBundleScope scope)
Constructor if an bundle entry. |
|
| Method Summary | |
|---|---|
int |
compareTo(I18nBundleEntry o)
|
boolean |
equals(Object o)
|
Locale |
getLocale()
|
URL |
getPath()
|
I18nBundleScope |
getScope()
|
int |
hashCode()
|
void |
load(Properties resource)
Deprecated. since 2.4 use load(Properties, Charset) instead,
charset must be provided to avoid encoding problems |
void |
load(Properties resource,
Charset encoding)
For a given language, load the resource file of this entry into the resource properties object. |
boolean |
matchLocale(Locale locale,
I18nBundleScope scope)
Method to match or not a bundle entry for a given scope and locale. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected URL path
protected Locale locale
protected I18nBundleScope scope
| Constructor Detail |
|---|
public I18nBundleEntry(URL path,
Locale locale,
I18nBundleScope scope)
path of the resource file, a scope and a
locale.
path - the path of the resource file fo the bundle entrylocale - the given locale of the bundle entryscope - the scope of the given entry| Method Detail |
|---|
public URL getPath()
public Locale getLocale()
public I18nBundleScope getScope()
public boolean matchLocale(Locale locale,
I18nBundleScope scope)
locale - the locale to matchscope - the highest scope to match
true if the entry match the scope and locale *
@Deprecated
public void load(Properties resource)
throws IOException
load(Properties, Charset) instead,
charset must be provided to avoid encoding problems
resource properties object.
resource - the save of resources already loaded
IOException - if any pb while reading resource file
public void load(Properties resource,
Charset encoding)
throws IOException
resource properties object. Use charset to load
properties. It could be different from resulting properties store.
resource - the save of resources already loadedencoding - Charset used to store the properties
IOException - if any pb while reading resource filepublic int compareTo(I18nBundleEntry o)
compareTo in interface Comparable<I18nBundleEntry>public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||