Package jakarta.faces.application
Class FacesMessage
java.lang.Object
jakarta.faces.application.FacesMessage
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- ParametrizableFacesMessage
 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.
 
- 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:
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringResourceBundleidentifier for messages whose message identifiers are defined in the JavaServer 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>ImmutableLisof 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 summary text.inthashCode()booleanvoidrendered()voidSet the localized detail text.voidsetSeverity(FacesMessage.Severity severity) Return 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 JavaServer 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.
- 
VALUESImmutableLisof validFacesMessage.Severityinstances, in ascending order of their ordinal value.
- 
VALUES_MAPImmutableMapof validFacesMessage.Severityinstances, keyed by name.
 
- 
- 
Constructor Details- 
FacesMessagepublic FacesMessage()Construct a newFacesMessagewith no initial values. The severity is set to Severity.INFO.
- 
FacesMessageConstruct a newFacesMessagewith just a summary. The detail is null, the severity is set toSeverity.INFO.
- 
FacesMessageConstruct a newFacesMessagewith the specified initial values. The severity is set to Severity.INFO.- Parameters:
- summary- - Localized summary message text
- detail- - Localized detail message text
 
- 
FacesMessageConstruct a newFacesMessagewith the specified initial values.- Parameters:
- severity- - the severity
- summary- - Localized summary message text
- detail- - Localized detail message text
 
 
- 
- 
Method Details- 
getSeverity- Returns:
 
- 
setSeverityReturn the severity level.
- 
getSummaryReturn the localized summary text.
- 
setSummarySet the localized summary text.- Parameters:
- summary- - The new localized summary text
 
- 
getDetail- Returns:
 
- 
setDetailSet the localized detail text.- Parameters:
- detail- - The new localized detail text
 
- 
isRenderedpublic boolean isRendered()
- 
renderedpublic void rendered()
- 
hashCodepublic int hashCode()
- 
equals
- 
toString
 
-