- java.lang.Object
-
- org.omnifaces.util.Messages.Message
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add()
Add the current message as a global message.void
add(String clientId)
Add the current message for the given client ID.ConverterException
asConverterException()
Returns the so far built message as aConverterException
.ValidatorException
asValidatorException()
Returns the so far built message as aValidatorException
.Messages.Message
detail(String detail, 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.FacesMessage
get()
Returns the so far built message.void
throwConverterException()
Throws the so far built message as aConverterException
.void
throwValidatorException()
Throws the so far built message as aValidatorException
.Messages.Message
warn()
Set the severity of the current message to WARN.
-
-
-
Method Detail
-
detail
public Messages.Message detail(String detail, 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(jakarta.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(jakarta.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(jakarta.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(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.
-
get
public FacesMessage get()
Returns the so far built message.- Returns:
- The so far built message.
-
asConverterException
public ConverterException asConverterException()
Returns the so far built message as aConverterException
.- Returns:
- The so far built message as a
ConverterException
. - Since:
- 3.8
-
asValidatorException
public ValidatorException asValidatorException()
Returns the so far built message as aValidatorException
.- Returns:
- The so far built message as a
ValidatorException
. - Since:
- 3.8
-
throwConverterException
public void throwConverterException()
Throws the so far built message as aConverterException
.- Throws:
ConverterException
- The so far built message as aConverterException
.- Since:
- 3.5
-
throwValidatorException
public void throwValidatorException()
Throws the so far built message as aValidatorException
.- Throws:
ValidatorException
- The so far built message as aValidatorException
.- Since:
- 3.5
-
-