|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.xwork.util.LocalizedTextUtil
Provides support for localization in XWork.
Constructor Summary | |
LocalizedTextUtil()
|
Method Summary | |
static void |
addDefaultResourceBundle(String resourceBundleName)
|
static String |
findDefaultText(String aTextName,
Locale locale)
Returns a localized message for the specified key, aTextName. |
static String |
findDefaultText(String aTextName,
Locale locale,
Object[] params)
Returns a localized message for the specified key, aTextName, substituting variables from the array of params into the message. |
static ResourceBundle |
findResourceBundle(String aBundleName,
Locale locale)
|
static String |
findText(Class aClass,
String aTextName,
Locale locale)
Calls findText(Class aClass, String aTextName, Locale locale, String defaultMessage, Object[] args)
with aTextName as the default message. |
static String |
findText(Class aClass,
String aTextName,
Locale locale,
String defaultMessage,
Object[] args)
Finds a localized text message for the given key, aTextName. |
static String |
findText(Class aClass,
String aTextName,
Locale locale,
String defaultMessage,
Object[] args,
OgnlValueStack valueStack)
Finds a localized text message for the given key, aTextName. |
static String |
findText(ResourceBundle bundle,
String aTextName,
Locale locale)
Finds a localized text message for the given key, aTextName, in the specified resource bundle with aTextName as the default message. |
static String |
findText(ResourceBundle bundle,
String aTextName,
Locale locale,
String defaultMessage,
Object[] args)
Finds a localized text message for the given key, aTextName, in the specified resource bundle. |
static String |
findText(ResourceBundle bundle,
String aTextName,
Locale locale,
String defaultMessage,
Object[] args,
OgnlValueStack valueStack)
|
static void |
setReloadBundles(boolean reloadBundles)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LocalizedTextUtil()
Method Detail |
public static void setReloadBundles(boolean reloadBundles)
public static void addDefaultResourceBundle(String resourceBundleName)
public static String findDefaultText(String aTextName, Locale locale) throws MissingResourceException
aTextName
- the message keylocale
- the locale the message should be for
MissingResourceException
- if no message can be found for the specified keypublic static String findDefaultText(String aTextName, Locale locale, Object[] params) throws MissingResourceException
aTextName
- the message keylocale
- the locale the message should be forparams
- an array of objects to be substituted into the message text
MissingResourceException
- if no message can be found for the specified keypublic static ResourceBundle findResourceBundle(String aBundleName, Locale locale)
public static String findText(Class aClass, String aTextName, Locale locale)
findText(Class aClass, String aTextName, Locale locale, String defaultMessage, Object[] args)
with aTextName as the default message.
findText(Class aClass, String aTextName, Locale locale, String defaultMessage, Object[] args)
public static String findText(Class aClass, String aTextName, Locale locale, String defaultMessage, Object[] args)
ModelDriven
Action, then look for message in
the model's class hierarchy (repeat sub-steps listed above).${...}
will be treated as an OGNL expression and evaluated as such.
aClass
- the class whose name to use as the start point for the searchaTextName
- the key to find the text message forlocale
- the locale the message should be fordefaultMessage
- the message to be returned if no text message can be found in any
resource bundle
public static String findText(Class aClass, String aTextName, Locale locale, String defaultMessage, Object[] args, OgnlValueStack valueStack)
ModelDriven
Action, then look for message in
the model's class hierarchy (repeat sub-steps listed above).${...}
will be treated as an OGNL expression and evaluated as such.
aClass
- the class whose name to use as the start point for the searchaTextName
- the key to find the text message forlocale
- the locale the message should be fordefaultMessage
- the message to be returned if no text message can be found in any
resource bundlevalueStack
- the value stack to use to evaluate expressions instead of the
one in the ActionContext ThreadLocal
public static String findText(ResourceBundle bundle, String aTextName, Locale locale)
${...}
will be treated as an OGNL expression and evaluated as such.
findText(java.util.ResourceBundle, java.lang.String, java.util.Locale, java.lang.String, java.lang.Object[])
public static String findText(ResourceBundle bundle, String aTextName, Locale locale, String defaultMessage, Object[] args)
${...}
will be treated as an OGNL expression and evaluated as such.
public static String findText(ResourceBundle bundle, String aTextName, Locale locale, String defaultMessage, Object[] args, OgnlValueStack valueStack)
|
XWork Project Page | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |