|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.universal.i18n.LocalStringsImpl
public class LocalStringsImpl
This class makes getting localized strings super-simple. This is the companion class to Strings. Use this class when performance may be an issue. I.e. Strings is all-static and creates a ResourceBundle on every call. This class is instantiated once and can be used over and over from the same package.
Specifics:
Note: You can not get an Exception out of calling this code! If the String or the properties file does not exist, it will return the String that you gave in the first place as the argument.
Example:
| Constructor Summary | |
|---|---|
LocalStringsImpl()
Create a LocalStringsImpl instance. |
|
LocalStringsImpl(java.lang.Class clazz)
Create a LocalStringsImpl instance. |
|
LocalStringsImpl(java.lang.String packageName,
java.lang.String propsName)
Create a LocalStringsImpl instance. |
|
| Method Summary | |
|---|---|
java.lang.String |
get(java.lang.String indexString)
Get a String from the caller's package's LocalStrings.properties |
java.lang.String |
get(java.lang.String indexString,
java.lang.Object... objects)
Get and format a String from the caller's package's LocalStrings.properties |
boolean |
getBoolean(java.lang.String indexString,
boolean defaultValue)
Get a boolean from the caller's package's LocalStrings.properties |
int |
getInt(java.lang.String indexString,
int defaultValue)
Get an integer from the caller's package's LocalStrings.properties |
java.lang.String |
getString(java.lang.String indexString,
java.lang.String defaultValue)
Get a String from the caller's package's LocalStrings.properties |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LocalStringsImpl()
public LocalStringsImpl(java.lang.Class clazz)
public LocalStringsImpl(java.lang.String packageName,
java.lang.String propsName)
| Method Detail |
|---|
public java.lang.String get(java.lang.String indexString)
indexString - The string index into the localized string file
public java.lang.String get(java.lang.String indexString,
java.lang.Object... objects)
indexString - The string index into the localized string fileobjects - The arguments to give to MessageFormat
public java.lang.String getString(java.lang.String indexString,
java.lang.String defaultValue)
indexString - The string index into the localized string file
public int getInt(java.lang.String indexString,
int defaultValue)
indexString - The string index into the localized string file
public boolean getBoolean(java.lang.String indexString,
boolean defaultValue)
indexString - The string index into the localized string file
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||