|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.rave.web.ui.util.MessageUtil
public class MessageUtil
Factory class for retrieving server-side i18n messages within the JSF framework. Note that the ServletResponse locale, content type, and character encoding are not set here. Since tags may be used outside the Sun Web Console, that task will most likely be done in the console's session filter.
Example:
ResponseWriter w = FacesContext.getCurrentInstance().getResponseWriter();
w.write(MessageUtil.getMessage("com.sun.rave.web.ui.Resources", "key"));
Constructor Summary | |
---|---|
protected |
MessageUtil()
|
Method Summary | |
---|---|
static java.lang.ClassLoader |
getCurrentLoader(java.lang.Object o)
Get current class loader from given object. |
protected static java.lang.String |
getFormattedMessage(java.lang.String message,
java.lang.Object[] args)
Format message using given arguments. |
protected static java.util.Locale |
getLocale()
Get locale from current FacesContext instance. |
protected static java.util.Locale |
getLocale(javax.faces.context.FacesContext context)
Get locale from given FacesContext object. |
static java.lang.String |
getMessage(javax.faces.context.FacesContext context,
java.lang.String baseName,
java.lang.String key)
Get a message from a desired resource bundle. |
static java.lang.String |
getMessage(javax.faces.context.FacesContext context,
java.lang.String baseName,
java.lang.String key,
java.lang.Object[] args)
Get a formatted message from a desired resource bundle. |
static java.lang.String |
getMessage(java.util.Locale locale,
java.lang.String baseName,
java.lang.String key,
java.lang.Object[] args)
Get a formatted message from a desired resource bundle. |
static java.lang.String |
getMessage(java.util.Locale locale,
java.lang.String baseName,
java.lang.String key,
java.lang.Object[] args,
java.lang.ClassLoader loader)
Get a formatted message from a desired resource bundle. |
static java.lang.String |
getMessage(java.lang.String baseName,
java.lang.String key)
Get a message from a desired resource bundle. |
static java.lang.String |
getMessage(java.lang.String baseName,
java.lang.String key,
java.lang.Object[] args)
Get a formatted message from a desired resource bundle. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected MessageUtil()
Method Detail |
---|
public static java.lang.String getMessage(javax.faces.context.FacesContext context, java.lang.String baseName, java.lang.String key)
context
- The FacesContext object used to obtain locale.baseName
- The fully qualified name of the resource bundle.key
- The key for the desired string.
java.lang.NullPointerException
- if context or baseName is null.public static java.lang.String getMessage(javax.faces.context.FacesContext context, java.lang.String baseName, java.lang.String key, java.lang.Object[] args)
context
- The FacesContext object used to obtain locale.baseName
- The fully qualified name of the resource bundle.key
- The key for the desired string.args
- The arguments to be inserted into the string.
java.lang.NullPointerException
- if context or baseName is null.public static java.lang.String getMessage(java.lang.String baseName, java.lang.String key)
baseName
- The fully qualified name of the resource bundle.key
- The key for the desired string.
java.lang.NullPointerException
- if baseName is null.public static java.lang.String getMessage(java.lang.String baseName, java.lang.String key, java.lang.Object[] args)
baseName
- The fully qualified name of the resource bundle.key
- The key for the desired string.args
- The arguments to be inserted into the string.
java.lang.NullPointerException
- if baseName is null.public static java.lang.String getMessage(java.util.Locale locale, java.lang.String baseName, java.lang.String key, java.lang.Object[] args)
locale
- The locale for which a resource bundle is desired.baseName
- The fully qualified name of the resource bundle.key
- The key for the desired string.args
- The arguments to be inserted into the string.
java.lang.NullPointerException
- if locale or baseName is null.public static java.lang.String getMessage(java.util.Locale locale, java.lang.String baseName, java.lang.String key, java.lang.Object[] args, java.lang.ClassLoader loader)
locale
- The locale for which a resource bundle is desired.baseName
- The fully qualified name of the resource bundle.key
- The key for the desired string.args
- The arguments to be inserted into the string.loader
- The class loader used to load the resource bundle.
java.lang.NullPointerException
- if locale, baseName, or loader is null.protected static java.lang.String getFormattedMessage(java.lang.String message, java.lang.Object[] args)
message
- The string used as a pattern for inserting arguments.args
- The arguments to be inserted into the string.protected static java.util.Locale getLocale()
protected static java.util.Locale getLocale(javax.faces.context.FacesContext context)
context
- The FacesContext object used to obtain locale.public static java.lang.ClassLoader getCurrentLoader(java.lang.Object o)
o
- Object used to obtain fallback class loader.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |