| java.lang.Object com.sun.rave.web.ui.util.MessageUtil
MessageUtil | public class MessageUtil extends Object (Code) | | 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"));
author: Dan Labrecque |
Method Summary | |
public static ClassLoader | getCurrentLoader(Object o) Get current class loader from given object. | protected static String | getFormattedMessage(String message, Object args) Format message using given arguments. | protected static Locale | getLocale() Get locale from current FacesContext instance. | protected static Locale | getLocale(FacesContext context) Get locale from given FacesContext object. | public static String | getMessage(FacesContext context, String baseName, String key) Get a message from a desired resource bundle. | public static String | getMessage(FacesContext context, String baseName, String key, Object args) Get a formatted message from a desired resource bundle. | public static String | getMessage(String baseName, String key) Get a message from a desired resource bundle. | public static String | getMessage(String baseName, String key, Object args) Get a formatted message from a desired resource bundle. | public static String | getMessage(Locale locale, String baseName, String key, Object args) Get a formatted message from a desired resource bundle. | public static String | getMessage(Locale locale, String baseName, String key, Object args, ClassLoader loader) Get a formatted message from a desired resource bundle. |
MessageUtil | protected MessageUtil()(Code) | | |
getCurrentLoader | public static ClassLoader getCurrentLoader(Object o)(Code) | | Get current class loader from given object.
Parameters: o - Object used to obtain fallback class loader. |
getFormattedMessage | protected static String getFormattedMessage(String message, Object args)(Code) | | Format message using given arguments.
Parameters: message - The string used as a pattern for inserting arguments. Parameters: args - The arguments to be inserted into the string. |
getLocale | protected static Locale getLocale()(Code) | | Get locale from current FacesContext instance.
|
getLocale | protected static Locale getLocale(FacesContext context)(Code) | | Get locale from given FacesContext object.
Parameters: context - The FacesContext object used to obtain locale. |
getMessage | public static String getMessage(FacesContext context, String baseName, String key)(Code) | | Get a message from a desired resource bundle.
Parameters: context - The FacesContext object used to obtain locale. Parameters: baseName - The fully qualified name of the resource bundle. Parameters: key - The key for the desired string. throws: NullPointerException - if context or baseName is null. |
getMessage | public static String getMessage(FacesContext context, String baseName, String key, Object args)(Code) | | Get a formatted message from a desired resource bundle.
Parameters: context - The FacesContext object used to obtain locale. Parameters: baseName - The fully qualified name of the resource bundle. Parameters: key - The key for the desired string. Parameters: args - The arguments to be inserted into the string. throws: NullPointerException - if context or baseName is null. |
getMessage | public static String getMessage(String baseName, String key)(Code) | | Get a message from a desired resource bundle.
Parameters: baseName - The fully qualified name of the resource bundle. Parameters: key - The key for the desired string. throws: NullPointerException - if baseName is null. |
getMessage | public static String getMessage(String baseName, String key, Object args)(Code) | | Get a formatted message from a desired resource bundle.
Parameters: baseName - The fully qualified name of the resource bundle. Parameters: key - The key for the desired string. Parameters: args - The arguments to be inserted into the string. throws: NullPointerException - if baseName is null. |
getMessage | public static String getMessage(Locale locale, String baseName, String key, Object args)(Code) | | Get a formatted message from a desired resource bundle.
Parameters: locale - The locale for which a resource bundle is desired. Parameters: baseName - The fully qualified name of the resource bundle. Parameters: key - The key for the desired string. Parameters: args - The arguments to be inserted into the string. throws: NullPointerException - if locale or baseName is null. |
getMessage | public static String getMessage(Locale locale, String baseName, String key, Object args, ClassLoader loader)(Code) | | Get a formatted message from a desired resource bundle.
Parameters: locale - The locale for which a resource bundle is desired. Parameters: baseName - The fully qualified name of the resource bundle. Parameters: key - The key for the desired string. Parameters: args - The arguments to be inserted into the string. Parameters: loader - The class loader used to load the resource bundle. throws: NullPointerException - if locale, baseName, or loader is null. |
|
|