- All Implemented Interfaces:
- Serializable
 FacesMessage represents a single validation (or other) message, which is typically associated with a
 particular component in the view. A FacesMessage instance may be created based on a
 specific messageId. The specification defines the set of messageIds for which there must be
 FacesMessage instances.
 
 The implementation must take the following steps when creating FacesMessage instances given a
 messageId:
 
Call
Application.getMessageBundle(). If non-null, locate the namedResourceBundle, using theLocalefrom the currentUIViewRootand see if it has a value for the argumentmessageId. If it does, treat the value as thesummaryof theFacesMessage. If it does not, or ifApplication.getMessageBundle()returnednull, look in theResourceBundlenamed by the value of the constantFACES_MESSAGESand see if it has a value for the argumentmessageId. If it does, treat the value as thesummaryof theFacesMessage. If it does not, there is no initialization information for theFacesMessageinstance.In all cases, if a
ResourceBundlehit is found for the{messageId}, look for further hits under the key{messageId}_detail. Use this value, if present, as thedetailfor the returnedFacesMessage.Make sure to perform any parameter substitution required for the
summaryanddetailof theFacesMessage.
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classClass used to represent message severity levels in a typesafe enumeration.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringResourceBundleidentifier for messages whose message identifiers are defined in the Jakarta Faces specification.static final FacesMessage.SeverityMessage severity level indicating that an error has occurred.static final FacesMessage.SeverityMessage severity level indicating that a serious error has occurred.static final FacesMessage.SeverityMessage severity level indicating an informational message rather than an error.static final FacesMessage.SeverityMessage severity level indicating that an error might have occurred.static final List<FacesMessage.Severity> ImmutableListof validFacesMessage.Severityinstances, in ascending order of their ordinal value.static final Map<String, FacesMessage.Severity> ImmutableMapof validFacesMessage.Severityinstances, keyed by name.
- 
Constructor SummaryConstructorsConstructorDescriptionConstruct a newFacesMessagewith no initial values.FacesMessage(FacesMessage.Severity severity, String summary, String detail) Construct a newFacesMessagewith the specified initial values.FacesMessage(String summary) Construct a newFacesMessagewith just a summary.FacesMessage(String summary, String detail) Construct a newFacesMessagewith the specified initial values.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturn the localized detail text.Return the severity level.Return the localized summary text.inthashCode()booleanvoidrendered()Marks this message as having been rendered to the client.voidSet the localized detail text.voidsetSeverity(FacesMessage.Severity severity) Set the severity level.voidsetSummary(String summary) Set the localized summary text.toString()
- 
Field Details- 
FACES_MESSAGESResourceBundleidentifier for messages whose message identifiers are defined in the Jakarta Faces specification.- See Also:
 
- 
SEVERITY_INFOMessage severity level indicating an informational message rather than an error. 
- 
SEVERITY_WARNMessage severity level indicating that an error might have occurred. 
- 
SEVERITY_ERRORMessage severity level indicating that an error has occurred. 
- 
SEVERITY_FATALMessage severity level indicating that a serious error has occurred. 
- 
VALUESImmutable Listof validFacesMessage.Severityinstances, in ascending order of their ordinal value.
- 
VALUES_MAPImmutable Mapof validFacesMessage.Severityinstances, keyed by name.
 
- 
- 
Constructor Details- 
FacesMessagepublic FacesMessage()Construct a new FacesMessagewith no initial values. The severity is set to Severity.INFO.
- 
FacesMessageConstruct a new FacesMessagewith just a summary. The detail isnull, the severity is set toSeverity.INFO.- Parameters:
- summary- the summary.
 
- 
FacesMessageConstruct a new FacesMessagewith the specified initial values. The severity is set to Severity.INFO.- Parameters:
- summary- Localized summary message text
- detail- Localized detail message text
- Throws:
- IllegalArgumentException- if the specified severity level is not one of the supported values
 
- 
FacesMessageConstruct a new FacesMessagewith the specified initial values.- Parameters:
- severity- the severity
- summary- Localized summary message text
- detail- Localized detail message text
- Throws:
- IllegalArgumentException- if the specified severity level is not one of the supported values
 
 
- 
- 
Method Details- 
getDetailReturn the localized detail text. If no localized detail text has been defined for this message, return the localized summary text instead. - Returns:
- the localized detail text.
 
- 
setDetailSet the localized detail text. - Parameters:
- detail- The new localized detail text
 
- 
getSeverity
- 
setSeveritySet the severity level. - Parameters:
- severity- The new severity level
- Throws:
- IllegalArgumentException- if the specified severity level is not one of the supported values
 
- 
getSummary
- 
setSummarySet the localized summary text. - Parameters:
- summary- The new localized summary text
 
- 
isRenderedpublic boolean isRendered()- Returns:
- trueif- rendered()has been called, otherwise- false
- Since:
- 2.0
 
- 
renderedpublic void rendered()Marks this message as having been rendered to the client. - Since:
- 2.0
 
- 
hashCode
- 
equals
- 
toString
 
-