Package com.sun.faces.util
Class MessageFactory
- java.lang.Object
-
- com.sun.faces.util.MessageFactory
-
public class MessageFactory extends Object
supported filters:
package
andprotection
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static Application
getApplication()
protected static ClassLoader
getCurrentLoader(Class fallbackClass)
static Object
getLabel(FacesContext context, UIComponent component)
Returns thelabel
property from the specified component.static FacesMessage
getMessage(FacesContext context, String messageId, FacesMessage.Severity severity, Object... params)
static FacesMessage
getMessage(FacesContext context, String messageId, Object... params)
Creates and returns a FacesMessage for the specified Locale.static FacesMessage
getMessage(String messageId, FacesMessage.Severity severity, Object... params)
static FacesMessage
getMessage(String messageId, Object... params)
This version of getMessage() is used for localizing implementation specific messages.static FacesMessage
getMessage(Locale locale, String messageId, FacesMessage.Severity severity, Object... params)
static FacesMessage
getMessage(Locale locale, String messageId, Object... params)
Creates and returns a FacesMessage for the specified Locale.
-
-
-
Method Detail
-
getMessage
public static FacesMessage getMessage(String messageId, FacesMessage.Severity severity, Object... params)
- Parameters:
severity
- set a custom severity- See Also:
getMessage(String, Object...)
-
getMessage
public static FacesMessage getMessage(Locale locale, String messageId, FacesMessage.Severity severity, Object... params)
- Parameters:
severity
- set a custom severity- See Also:
getMessage(Locale, String, Object...)
-
getMessage
public static FacesMessage getMessage(FacesContext context, String messageId, FacesMessage.Severity severity, Object... params)
- Parameters:
severity
- set a custom severity- See Also:
getMessage(FacesContext, String, Object...)
-
getMessage
public static FacesMessage getMessage(String messageId, Object... params)
This version of getMessage() is used for localizing implementation specific messages.
- Parameters:
messageId
- - the key of the message in the resource bundleparams
- - substittion parameters- Returns:
- a localized
FacesMessage
with the severity of FacesMessage.SEVERITY_ERROR
-
getMessage
public static FacesMessage getMessage(Locale locale, String messageId, Object... params)
Creates and returns a FacesMessage for the specified Locale.
- Parameters:
locale
- - the targetLocale
messageId
- - the key of the message in the resource bundleparams
- - substittion parameters- Returns:
- a localized
FacesMessage
with the severity of FacesMessage.SEVERITY_ERROR
-
getMessage
public static FacesMessage getMessage(FacesContext context, String messageId, Object... params)
Creates and returns a FacesMessage for the specified Locale.
- Parameters:
context
- - theFacesContext
for the current requestmessageId
- - the key of the message in the resource bundleparams
- - substittion parameters- Returns:
- a localized
FacesMessage
with the severity of FacesMessage.SEVERITY_ERROR
-
getLabel
public static Object getLabel(FacesContext context, UIComponent component)
Returns the
label
property from the specified component.- Parameters:
context
- - theFacesContext
for the current requestcomponent
- - the component of interest- Returns:
- the label, if any, of the component
-
getApplication
protected static Application getApplication()
-
getCurrentLoader
protected static ClassLoader getCurrentLoader(Class fallbackClass)
-
-