public interface ConstantsWithLookup extends Constants
Constants
, a tag interface that
facilitates locale-sensitive, compile-time binding of constant values
supplied from properties files with the added ability to look up constants at
runtime with a string key.
ConstantsWithLookup
extends
Constants
and is identical in behavior,
adding only a family of special-purpose lookup methods such as
getString(String)
.
It is generally preferable to extend Constants
rather than
ConstantsWithLookup
because ConstantsWithLookup
forces all constants to be retained in the compiled script, preventing the
GWT compiler from pruning unused constant accessors.
com.google.gwt.i18n.I18N
.
GWT.create(Class)
.Constants
Constants.DefaultBooleanValue, Constants.DefaultDoubleValue, Constants.DefaultFloatValue, Constants.DefaultIntValue, Constants.DefaultStringArrayValue, Constants.DefaultStringMapValue, Constants.DefaultStringValue
LocalizableResource.DefaultLocale, LocalizableResource.Description, LocalizableResource.Generate, LocalizableResource.GeneratedFrom, LocalizableResource.GenerateKeys, LocalizableResource.Key, LocalizableResource.Meaning
Modifier and Type | Method and Description |
---|---|
boolean |
getBoolean(String methodName)
Look up
boolean by method name. |
double |
getDouble(String methodName)
Look up
double by method name. |
float |
getFloat(String methodName)
Look up
float by method name. |
int |
getInt(String methodName)
Look up
int by method name. |
Map<String,String> |
getMap(String methodName)
Look up
Map by method name. |
String |
getString(String methodName)
Look up
String by method name. |
String[] |
getStringArray(String methodName)
Look up
String[] by method name. |
boolean getBoolean(String methodName) throws MissingResourceException
boolean
by method name.methodName
- method nameMissingResourceException
- if methodName is not validdouble getDouble(String methodName) throws MissingResourceException
double
by method name.methodName
- method nameMissingResourceException
- if methodName is not validfloat getFloat(String methodName) throws MissingResourceException
float
by method name.methodName
- method nameMissingResourceException
- if methodName is not validint getInt(String methodName) throws MissingResourceException
int
by method name.methodName
- method nameMissingResourceException
- if methodName is not validMap<String,String> getMap(String methodName) throws MissingResourceException
Map
by method name.methodName
- method nameMissingResourceException
- if methodName is not validString getString(String methodName) throws MissingResourceException
String
by method name.methodName
- method nameMissingResourceException
- if methodName is not validString[] getStringArray(String methodName) throws MissingResourceException
String[]
by method name.methodName
- method nameMissingResourceException
- if methodName is not validCopyright © 2016. All rights reserved.