|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gwt.i18n.rebind.AbstractResource
public abstract class AbstractResource
AbstractResource serves the same purpose as java ResourceBundle/PropertyResourceBundle.
Each Resource belongs to a resource tree, indicated by the
path attribute.
AbstractResource uses a Factory pattern rather than a single static method to load itself given an abstract string path.
One advanced feature which should not be used outside the core GWT system is that resources can have more than one parent, for instance pets_en_US could have pets_en as one parent and animals_en_US as another. The alternative parents have lower precedence than any primary parent. Each alternative parent is associated with a separate resource tree.
| Nested Class Summary | |
|---|---|
static class |
AbstractResource.MissingResourceException
Exception indicating a required resource was not found. |
static class |
AbstractResource.ResourceList
Encapsulates an ordered set of resources to search for translations. |
| Field Summary | |
|---|---|
static int |
REPORT_KEYS_THRESHOLD
Error messages concerning missing keys should include the defined keys if the number of keys is below this threshold. |
| Constructor Summary | |
|---|---|
AbstractResource(GwtLocale matchLocale)
|
|
| Method Summary | |
|---|---|
java.util.Collection<java.lang.String> |
getExtensions(java.lang.String key)
|
java.lang.String |
getRequiredString(java.lang.String key)
Get a string and fail if not present. |
java.lang.String |
getRequiredStringExt(java.lang.String key,
java.lang.String extension)
Get a string (with optional extension) and fail if not present. |
java.lang.String |
getString(java.lang.String key)
Get a key. |
abstract java.lang.String |
getStringExt(java.lang.String key,
java.lang.String extension)
Get a key with an extension. |
java.util.Set<java.lang.String> |
keySet()
Keys associated with this resource. |
boolean |
notEmpty()
|
java.lang.String |
toString()
|
java.lang.String |
toVerboseString()
A multi-line representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int REPORT_KEYS_THRESHOLD
| Constructor Detail |
|---|
public AbstractResource(GwtLocale matchLocale)
| Method Detail |
|---|
public java.util.Collection<java.lang.String> getExtensions(java.lang.String key)
key - public final java.lang.String getRequiredString(java.lang.String key)
key -
public final java.lang.String getRequiredStringExt(java.lang.String key,
java.lang.String extension)
key - extension -
public final java.lang.String getString(java.lang.String key)
key - key to lookup
ResourceBundle.getString(java.lang.String)
public abstract java.lang.String getStringExt(java.lang.String key,
java.lang.String extension)
key - to lookupextension - extension of the key, nullable
public java.util.Set<java.lang.String> keySet()
public boolean notEmpty()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toVerboseString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||