public class I18nBundleEntry extends Object implements Comparable<I18nBundleEntry>
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| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
I18nBundleEntry(URL path,
Locale locale,
I18nBundleScope scope)
Constructor if an bundle entry.
|
| Modifier and Type | Method and Description |
|---|---|
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() |
protected URL path
protected Locale locale
protected I18nBundleScope scope
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 entrypublic URL getPath()
public Locale getLocale()
public I18nBundleScope getScope()
public boolean matchLocale(Locale locale, I18nBundleScope scope)
locale - the locale to matchscope - the highest scope to matchtrue 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 problemsresource properties object.resource - the save of resources already loadedIOException - if any pb while reading resource filepublic 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 propertiesIOException - if any pb while reading resource filepublic int compareTo(I18nBundleEntry o)
compareTo in interface Comparable<I18nBundleEntry>Copyright © 2004–2018 CodeLutin. All rights reserved.