FacesMessage represents a single validation (or
other) message, which is typically associated with a particular
component in the view. A javax.faces.application.FacesMessage instance may be created
based on a specific messageId. The specification defines
the set of messageIds for which there must be
javax.faces.application.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 currentjavax.faces.component.UIViewRootand see if it has a value for the argumentmessageId. If it does, treat the value as thesummaryof theFacesMessage. If it does not, or ifApplication#getMessageBundlereturnednull, 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.
| Modifier and Type | Class and Description |
|---|---|
| public static class | FacesMessage.Severity
Class used to represent message severity levels in a typesafe enumeration. |
| Modifier and Type | Field and Description |
|---|---|
| private static Map | |
| private transient String | |
| public static final String | FACES_MESSAGES
|
| private transient boolean | |
| private static final long | |
| private transient FacesMessage. | |
| public static final FacesMessage. | SEVERITY_ERROR
Message severity level indicating that an error has occurred. |
| private static final String | |
| public static final FacesMessage. | SEVERITY_FATAL
Message severity level indicating that a serious error has occurred. |
| private static final String | |
| public static final FacesMessage. | SEVERITY_INFO
Message severity level indicating an informational message rather than an error. |
| private static final String | |
| public static final FacesMessage. | SEVERITY_WARN
Message severity level indicating that an error might have occurred. |
| private static final String | |
| private transient String | |
| private static final FacesMessage. | values
Array of all defined values, ascending order of ordinal value. |
| public static final List | VALUES
Immutable |
| public static final Map | VALUES_MAP
Immutable |
| Access | Constructor and Description |
|---|---|
| public | |
| public | FacesMessage(String
the summary. summary)Construct a new |
| public | FacesMessage(String
Localized summary message text summary, String Localized detail message text detail)Construct a new |
| public | FacesMessage(FacesMessage.
the severity severity,Localized summary message text summary, String Localized detail message text detail)Construct a new |
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| public FacesMessage. | |
| public String | |
| public boolean | |
| private void | readObject(ObjectInputStream
The binary input of the object to be read in)Reconstruct |
| public void | |
| public void | |
| public void | |
| public void | |
| private void | writeObject(ObjectOutputStream
The target stream to which the object will be written. out)Persist |
| _MODIFIABLE_MAP | back to summary |
|---|---|
| private static Map<String, FacesMessage. | |
| detail | back to summary |
|---|---|
| private transient String detail | |
| FACES_MESSAGES | back to summary |
|---|---|
| public static final String FACES_MESSAGES
| |
| rendered | back to summary |
|---|---|
| private transient boolean rendered | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| severity | back to summary |
|---|---|
| private transient FacesMessage. | |
| SEVERITY_ERROR | back to summary |
|---|---|
| public static final FacesMessage. Message severity level indicating that an error has occurred. | |
| SEVERITY_ERROR_NAME | back to summary |
|---|---|
| private static final String SEVERITY_ERROR_NAME | |
| SEVERITY_FATAL | back to summary |
|---|---|
| public static final FacesMessage. Message severity level indicating that a serious error has occurred. | |
| SEVERITY_FATAL_NAME | back to summary |
|---|---|
| private static final String SEVERITY_FATAL_NAME | |
| SEVERITY_INFO | back to summary |
|---|---|
| public static final FacesMessage. Message severity level indicating an informational message rather than an error. | |
| SEVERITY_INFO_NAME | back to summary |
|---|---|
| private static final String SEVERITY_INFO_NAME | |
| SEVERITY_WARN | back to summary |
|---|---|
| public static final FacesMessage. Message severity level indicating that an error might have occurred. | |
| SEVERITY_WARN_NAME | back to summary |
|---|---|
| private static final String SEVERITY_WARN_NAME | |
| summary | back to summary |
|---|---|
| private transient String summary | |
| values | back to summary |
|---|---|
| private static final FacesMessage. Array of all defined values, ascending order of ordinal value. Be sure you include any new instances created above, in the same order. | |
| VALUES | back to summary |
|---|---|
| public static final List<E> VALUES Immutable | |
| VALUES_MAP | back to summary |
|---|---|
| public static final Map<K, V> VALUES_MAP Immutable | |
| FacesMessage | back to summary |
|---|---|
| public FacesMessage() Construct a new | |
| FacesMessage | back to summary |
|---|---|
| public FacesMessage(String summary) Construct a new
| |
| FacesMessage | back to summary |
|---|---|
| public FacesMessage(String summary, String detail) Construct a new
| |
| FacesMessage | back to summary |
|---|---|
| public FacesMessage(FacesMessage. Construct a new
| |
| getDetail | back to summary |
|---|---|
| public String getDetail() Return the localized detail text. If no localized detail text has been defined for this message, return the localized summary text instead.
| |
| getSeverity | back to summary |
|---|---|
| public FacesMessage. Return the severity level.
| |
| getSummary | back to summary |
|---|---|
| public String getSummary() Return the localized summary text.
| |
| isRendered | back to summary |
|---|---|
public boolean isRendered()
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException Reconstruct
| |
| rendered | back to summary |
|---|---|
| public void rendered() Marks this message as having been rendered to the client.
| |
| setDetail | back to summary |
|---|---|
| public void setDetail(String detail) Set the localized detail text.
| |
| setSeverity | back to summary |
|---|---|
| public void setSeverity(FacesMessage. Set the severity level.
| |
| setSummary | back to summary |
|---|---|
| public void setSummary(String summary) Set the localized summary text.
| |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream out) throws IOException Persist
| |
Class used to represent message severity levels in a typesafe enumeration.
| Modifier and Type | Field and Description |
|---|---|
| private static int | nextOrdinal
Static counter returning the ordinal value to be assigned to the next instance that is created. |
| private final int | ordinal
The ordinal value assigned to this instance. |
| pack-priv String | severityName
The (optional) name for this severity. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | compareTo(Object
The other object to be compared to other)Implements java. Compare this |
| public int | |
| public String | toString()
Overrides java. Return a String representation of this |
| nextOrdinal | back to summary |
|---|---|
| private static int nextOrdinal Static counter returning the ordinal value to be assigned to the next instance that is created. | |
| ordinal | back to summary |
|---|---|
| private final int ordinal The ordinal value assigned to this instance. | |
| severityName | back to summary |
|---|---|
| pack-priv String severityName The (optional) name for this severity. | |
| Severity | back to summary |
|---|---|
| private Severity(String newSeverityName) Private constructor to disable the creation of new instances. | |
| compareTo | back to summary |
|---|---|
| public int compareTo(Object other) Implements java. Compare this
| |
| getOrdinal | back to summary |
|---|---|
| public int getOrdinal() Return the ordinal value of this
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Return a String representation of this
| |