|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.spice.salt.i18n.I18nResources
public class I18nResources
A class to simplify extracting localized strings, icons and other common resources from a ResourceBundle.
| Field Summary | |
|---|---|
protected String |
m_baseName
Base name of resource bundle. |
protected ClassLoader |
m_classLoader
ClassLoader from which to load resources. |
protected Locale |
m_locale
Local of Resources. |
| Constructor Summary | |
|---|---|
I18nResources(String baseName,
Locale locale,
ClassLoader classLoader)
Constructor that builds a manager in specified locale. |
|
| Method Summary | |
|---|---|
String |
format(String key,
Object arg1)
Retrieve a string from resource bundle and format it with specified args. |
String |
format(String key,
Object[] args)
Retrieve a string from resource bundle and format it with specified args. |
String |
format(String key,
Object arg1,
Object arg2)
Retrieve a string from resource bundle and format it with specified args. |
String |
format(String key,
Object arg1,
Object arg2,
Object arg3)
Retrieve a string from resource bundle and format it with specified args. |
String |
format(String key,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
Retrieve a string from resource bundle and format it with specified args. |
String |
format(String key,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5)
Retrieve a string from resource bundle and format it with specified args. |
boolean |
getBoolean(String key)
Retrieve a boolean from bundle. |
boolean |
getBoolean(String key,
boolean defaultValue)
Retrieve a boolean from bundle. |
ResourceBundle |
getBundle()
Retrieve underlying ResourceBundle. |
byte |
getByte(String key)
Retrieve a byte from bundle. |
byte |
getByte(String key,
byte defaultValue)
Retrieve a byte from bundle. |
char |
getChar(String key)
Retrieve a char from bundle. |
char |
getChar(String key,
char defaultValue)
Retrieve a char from bundle. |
Date |
getDate(String key)
Retrieve a date from bundle. |
Date |
getDate(String key,
Date defaultValue)
Retrieve a date from bundle. |
Date |
getDateTime(String key)
Retrieve a date + time from bundle. |
Date |
getDateTime(String key,
Date defaultValue)
Retrieve a time from bundle. |
double |
getDouble(String key)
Retrieve a double from bundle. |
double |
getDouble(String key,
double defaultValue)
Retrieve a double from bundle. |
float |
getFloat(String key)
Retrieve a float from bundle. |
float |
getFloat(String key,
float defaultValue)
Retrieve a float from bundle. |
int |
getInteger(String key)
Retrieve a integer from bundle. |
int |
getInteger(String key,
int defaultValue)
Retrieve a integer from bundle. |
long |
getLong(String key)
Retrieve a long from bundle. |
long |
getLong(String key,
long defaultValue)
Retrieve a long from bundle. |
short |
getShort(String key)
Retrieve a short from bundle. |
short |
getShort(String key,
short defaultValue)
Retrieve a short from bundle. |
String |
getString(String key)
Retrieve a raw string from bundle. |
String |
getString(String key,
String defaultValue)
Retrieve a raw string from bundle. |
Date |
getTime(String key)
Retrieve a time from bundle. |
Date |
getTime(String key,
Date defaultValue)
Retrieve a time from bundle. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Locale m_locale
protected final String m_baseName
protected final ClassLoader m_classLoader
| Constructor Detail |
|---|
public I18nResources(String baseName,
Locale locale,
ClassLoader classLoader)
baseName - the base name of ResourceBundlelocale - the Locale for resource bundleclassLoader - the classLoader to load ResourceBundle from| Method Detail |
|---|
public boolean getBoolean(String key,
boolean defaultValue)
key - the key of resourcedefaultValue - the default value if key is missing
public boolean getBoolean(String key)
throws MissingResourceException
key - the key of resource
MissingResourceException
public byte getByte(String key,
byte defaultValue)
key - the key of resourcedefaultValue - the default value if key is missing
public byte getByte(String key)
throws MissingResourceException
key - the key of resource
MissingResourceException
public char getChar(String key,
char defaultValue)
key - the key of resourcedefaultValue - the default value if key is missing
public char getChar(String key)
throws MissingResourceException
key - the key of resource
MissingResourceException
public short getShort(String key,
short defaultValue)
key - the key of resourcedefaultValue - the default value if key is missing
public short getShort(String key)
throws MissingResourceException
key - the key of resource
MissingResourceException
public int getInteger(String key,
int defaultValue)
key - the key of resourcedefaultValue - the default value if key is missing
public int getInteger(String key)
throws MissingResourceException
key - the key of resource
MissingResourceException
public long getLong(String key,
long defaultValue)
key - the key of resourcedefaultValue - the default value if key is missing
public long getLong(String key)
throws MissingResourceException
key - the key of resource
MissingResourceException
public float getFloat(String key,
float defaultValue)
key - the key of resourcedefaultValue - the default value if key is missing
public float getFloat(String key)
throws MissingResourceException
key - the key of resource
MissingResourceException
public double getDouble(String key,
double defaultValue)
key - the key of resourcedefaultValue - the default value if key is missing
public double getDouble(String key)
throws MissingResourceException
key - the key of resource
MissingResourceException
public Date getDate(String key,
Date defaultValue)
key - the key of resourcedefaultValue - the default value if key is missing
public Date getDate(String key)
throws MissingResourceException
key - the key of resource
MissingResourceException
public Date getTime(String key,
Date defaultValue)
key - the key of resourcedefaultValue - the default value if key is missing
public Date getTime(String key)
throws MissingResourceException
key - the key of resource
MissingResourceException
public Date getDateTime(String key,
Date defaultValue)
key - the key of resourcedefaultValue - the default value if key is missing
public Date getDateTime(String key)
throws MissingResourceException
key - the key of resource
MissingResourceException
public String getString(String key)
throws MissingResourceException
key - the key of resource
MissingResourceException
public String getString(String key,
String defaultValue)
key - the key of resourcedefaultValue - the default value if key is missing
public String format(String key,
Object arg1)
key - the key for resourcearg1 - an arg
public String format(String key,
Object arg1,
Object arg2)
key - the key for resourcearg1 - an argarg2 - an arg
public String format(String key,
Object arg1,
Object arg2,
Object arg3)
key - the key for resourcearg1 - an argarg2 - an argarg3 - an arg
public String format(String key,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
key - the key for resourcearg1 - an argarg2 - an argarg3 - an argarg4 - an arg
public String format(String key,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5)
key - the key for resourcearg1 - an argarg2 - an argarg3 - an argarg4 - an argarg5 - an arg
public String format(String key,
Object[] args)
key - the key for resourceargs - an array of args
public final ResourceBundle getBundle()
throws MissingResourceException
MissingResourceException - if an error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||