org.omnifaces.util
Class Messages.Message

java.lang.Object
  extended by org.omnifaces.util.Messages.Message
Enclosing class:
Messages

public static class Messages.Message
extends java.lang.Object

Faces message builder.

Since:
1.1
Author:
Bauke Scholtz

Method Summary
 void add()
          Add the current message as a global message.
 void add(java.lang.String clientId)
          Add the current message for the given client ID.
 Messages.Message detail(java.lang.String detail, java.lang.Object... params)
          Set the detail message of the current message.
 Messages.Message error()
          Set the severity of the current message to ERROR.
 Messages.Message fatal()
          Set the severity of the current message to FATAL.
 Messages.Message flash()
          Make the current message a flash message.
 javax.faces.application.FacesMessage get()
          Returns the so far built message.
 Messages.Message warn()
          Set the severity of the current message to WARN.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

detail

public Messages.Message detail(java.lang.String detail,
                               java.lang.Object... params)
Set the detail message of the current message.

Parameters:
detail - The detail message to be set on the current message.
params - The detail message format parameters, if any.
Returns:
The current Messages.Message instance for further building.
See Also:
FacesMessage.setDetail(String)

warn

public Messages.Message warn()
Set the severity of the current message to WARN. Note: it defaults to INFO already.

Returns:
The current Messages.Message instance for further building.
See Also:
FacesMessage.setSeverity(javax.faces.application.FacesMessage.Severity)

error

public Messages.Message error()
Set the severity of the current message to ERROR. Note: it defaults to INFO already.

Returns:
The current Messages.Message instance for further building.
See Also:
FacesMessage.setSeverity(javax.faces.application.FacesMessage.Severity)

fatal

public Messages.Message fatal()
Set the severity of the current message to FATAL. Note: it defaults to INFO already.

Returns:
The current Messages.Message instance for further building.
See Also:
FacesMessage.setSeverity(javax.faces.application.FacesMessage.Severity)

flash

public Messages.Message flash()
Make the current message a flash message. Use this when you need to display the message after a redirect.

Returns:
The current Messages.Message instance for further building.
See Also:
Flash.setKeepMessages(boolean)

add

public void add(java.lang.String clientId)
Add the current message for the given client ID.

Parameters:
clientId - The client ID to add the current message for.
See Also:
FacesContext.addMessage(String, FacesMessage)

add

public void add()
Add the current message as a global message.

See Also:
FacesContext.addMessage(String, FacesMessage)

get

public javax.faces.application.FacesMessage get()
Returns the so far built message.

Returns:
The so far built message.