Package jakarta.faces.application
Class FacesMessage
- java.lang.Object
- 
- jakarta.faces.application.FacesMessage
 
- 
- All Implemented Interfaces:
- Serializable
 - Direct Known Subclasses:
- ParametrizableFacesMessage
 
 public class FacesMessage extends Object implements Serializable 
 The implementation must take the following steps when creating FacesMessage instances given a messageId:FacesMessagerepresents a single validation (or other) message, which is typically associated with a particular component in the view. AFacesMessageinstance may be created based on a specific messageId. The specification defines the set of messageIds for which there must beFacesMessageinstances.- Call
 Application.getMessageBundle(). Ifnon-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()returned null, look in the ResourceBundle named by the value of the constantFACES_MESSAGESand see if it has a value for the argument messageId. If it does, treat the value as the summary of 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:
- Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classFacesMessage.Severity
 - 
Field SummaryFields Modifier and Type Field Description static StringFACES_MESSAGESResourceBundleidentifier for messages whose message identifiers are defined in the JavaServer Faces specification.static FacesMessage.SeveritySEVERITY_ERRORMessage severity level indicating that an error has occurred.static FacesMessage.SeveritySEVERITY_FATALMessage severity level indicating that a serious error has occurred.static FacesMessage.SeveritySEVERITY_INFOMessage severity level indicating an informational message rather than an error.static FacesMessage.SeveritySEVERITY_WARNMessage severity level indicating that an error might have occurred.static ListVALUESImmutableLisof validFacesMessage.Severityinstances, in ascending order of their ordinal value.static MapVALUES_MAPImmutableMapof validFacesMessage.Severityinstances, keyed by name.
 - 
Constructor SummaryConstructors Constructor Description FacesMessage()Construct 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 SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDetail()FacesMessage.SeveritygetSeverity()StringgetSummary()Return the localized summary text.booleanisRendered()voidrendered()voidsetDetail(String detail)Set the localized detail text.voidsetSeverity(FacesMessage.Severity severity)Return the severity level.voidsetSummary(String summary)Set the localized summary text.
 
- 
- 
- 
Field Detail- 
FACES_MESSAGESpublic static final String FACES_MESSAGES ResourceBundleidentifier for messages whose message identifiers are defined in the JavaServer Faces specification.- See Also:
- Constant Field Values
 
 - 
SEVERITY_INFOpublic static final FacesMessage.Severity SEVERITY_INFO Message severity level indicating an informational message rather than an error.
 - 
SEVERITY_WARNpublic static final FacesMessage.Severity SEVERITY_WARN Message severity level indicating that an error might have occurred.
 - 
SEVERITY_ERRORpublic static final FacesMessage.Severity SEVERITY_ERROR Message severity level indicating that an error has occurred.
 - 
SEVERITY_FATALpublic static final FacesMessage.Severity SEVERITY_FATAL Message severity level indicating that a serious error has occurred.
 - 
VALUESpublic static final List VALUES ImmutableLisof validFacesMessage.Severityinstances, in ascending order of their ordinal value.
 - 
VALUES_MAPpublic static final Map VALUES_MAP ImmutableMapof validFacesMessage.Severityinstances, keyed by name.
 
- 
 - 
Constructor Detail- 
FacesMessagepublic FacesMessage() Construct a newFacesMessagewith no initial values. The severity is set to Severity.INFO.
 - 
FacesMessagepublic FacesMessage(String summary) Construct a newFacesMessagewith just a summary. The detail is null, the severity is set toSeverity.INFO.
 - 
FacesMessagepublic FacesMessage(String summary, String detail) Construct a newFacesMessagewith the specified initial values. The severity is set to Severity.INFO.- Parameters:
- summary- - Localized summary message text
- detail- - Localized detail message text
 
 - 
FacesMessagepublic FacesMessage(FacesMessage.Severity severity, String summary, String detail) Construct a newFacesMessagewith the specified initial values.- Parameters:
- severity- - the severity
- summary- - Localized summary message text
- detail- - Localized detail message text
 
 
- 
 - 
Method Detail- 
getSeveritypublic FacesMessage.Severity getSeverity() - Returns:
 
 - 
setSeveritypublic void setSeverity(FacesMessage.Severity severity) Return the severity level.
 - 
getSummarypublic String getSummary() Return the localized summary text.
 - 
setSummarypublic void setSummary(String summary) Set the localized summary text.- Parameters:
- summary- - The new localized summary text
 
 - 
getDetailpublic String getDetail() - Returns:
 
 - 
setDetailpublic void setDetail(String detail) Set the localized detail text.- Parameters:
- detail- - The new localized detail text
 
 - 
isRenderedpublic boolean isRendered() 
 - 
renderedpublic void rendered() 
 
- 
 
-