- java.lang.Object
-
- org.omnifaces.util.MessagesLocal
-
public final class MessagesLocal extends Object
Collection of utility methods for the Faces API with respect to working with
FacesMessage
.The difference with
Messages
is that no one method ofMessagesLocal
obtains theFacesContext
from the current thread byFacesContext.getCurrentInstance()
. This job is up to the caller. This is more efficient in situations where multiple utility methods needs to be called at the same time. InvokingFacesContext.getCurrentInstance()
is at its own an extremely cheap operation, however as it's to be obtained as aThreadLocal
variable, it's during the call still blocking all other running threads for some nanoseconds or so.- Since:
- 4.2
- Author:
- Bauke Scholtz
- See Also:
Messages
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
add(FacesContext context, FacesMessage.Severity severity, String clientId, String message, Object... params)
static void
add(FacesContext context, String clientId, FacesMessage message)
static void
addError(FacesContext context, String clientId, String message, Object... params)
static void
addFatal(FacesContext context, String clientId, String message, Object... params)
static void
addFlash(FacesContext context, FacesMessage.Severity severity, String clientId, String message, Object... params)
static void
addFlash(FacesContext context, String clientId, FacesMessage message)
static void
addFlashError(FacesContext context, String clientId, String message, Object... params)
static void
addFlashFatal(FacesContext context, String clientId, String message, Object... params)
static void
addFlashGlobal(FacesContext context, FacesMessage message)
static void
addFlashGlobalError(FacesContext context, String message, Object... params)
static void
addFlashGlobalFatal(FacesContext context, String message, Object... params)
static void
addFlashGlobalInfo(FacesContext context, String message, Object... params)
static void
addFlashGlobalWarn(FacesContext context, String message, Object... params)
static void
addFlashInfo(FacesContext context, String clientId, String message, Object... params)
static void
addFlashWarn(FacesContext context, String clientId, String message, Object... params)
static void
addGlobal(FacesContext context, FacesMessage message)
static void
addGlobal(FacesContext context, FacesMessage.Severity severity, String message, Object... params)
static void
addGlobalError(FacesContext context, String message, Object... params)
static void
addGlobalFatal(FacesContext context, String message, Object... params)
static void
addGlobalInfo(FacesContext context, String message, Object... params)
static void
addGlobalWarn(FacesContext context, String message, Object... params)
static void
addInfo(FacesContext context, String clientId, String message, Object... params)
static void
addWarn(FacesContext context, String clientId, String message, Object... params)
static boolean
clear(FacesContext context, FacesMessage.Severity severity, String... clientIds)
static boolean
clear(FacesContext context, String... clientIds)
static boolean
clearError(FacesContext context, String... clientIds)
static boolean
clearFatal(FacesContext context, String... clientIds)
static boolean
clearGlobal(FacesContext context)
static boolean
clearGlobal(FacesContext context, FacesMessage.Severity severity)
static boolean
clearGlobalError(FacesContext context)
static boolean
clearGlobalFatal(FacesContext context)
static boolean
clearGlobalInfo(FacesContext context)
static boolean
clearGlobalWarn(FacesContext context)
static boolean
clearInfo(FacesContext context, String... clientIds)
static boolean
clearWarn(FacesContext context, String... clientIds)
static boolean
isEmpty(FacesContext context)
static boolean
isEmpty(FacesContext context, String clientId)
static boolean
isGlobalEmpty(FacesContext context)
-
-
-
Method Detail
-
add
public static void add(FacesContext context, String clientId, FacesMessage message)
- See Also:
Messages.add(String, FacesMessage)
-
add
public static void add(FacesContext context, FacesMessage.Severity severity, String clientId, String message, Object... params)
-
addInfo
public static void addInfo(FacesContext context, String clientId, String message, Object... params)
-
addWarn
public static void addWarn(FacesContext context, String clientId, String message, Object... params)
-
addError
public static void addError(FacesContext context, String clientId, String message, Object... params)
-
addFatal
public static void addFatal(FacesContext context, String clientId, String message, Object... params)
-
addGlobal
public static void addGlobal(FacesContext context, FacesMessage message)
- See Also:
Messages.addGlobal(FacesMessage)
-
addGlobal
public static void addGlobal(FacesContext context, FacesMessage.Severity severity, String message, Object... params)
-
addGlobalInfo
public static void addGlobalInfo(FacesContext context, String message, Object... params)
-
addGlobalWarn
public static void addGlobalWarn(FacesContext context, String message, Object... params)
-
addGlobalError
public static void addGlobalError(FacesContext context, String message, Object... params)
-
addGlobalFatal
public static void addGlobalFatal(FacesContext context, String message, Object... params)
-
addFlash
public static void addFlash(FacesContext context, String clientId, FacesMessage message)
- See Also:
Messages.addFlash(String, FacesMessage)
-
addFlash
public static void addFlash(FacesContext context, FacesMessage.Severity severity, String clientId, String message, Object... params)
-
addFlashInfo
public static void addFlashInfo(FacesContext context, String clientId, String message, Object... params)
-
addFlashWarn
public static void addFlashWarn(FacesContext context, String clientId, String message, Object... params)
-
addFlashError
public static void addFlashError(FacesContext context, String clientId, String message, Object... params)
-
addFlashFatal
public static void addFlashFatal(FacesContext context, String clientId, String message, Object... params)
-
addFlashGlobal
public static void addFlashGlobal(FacesContext context, FacesMessage message)
- See Also:
Messages.addFlashGlobal(FacesMessage)
-
addFlashGlobalInfo
public static void addFlashGlobalInfo(FacesContext context, String message, Object... params)
-
addFlashGlobalWarn
public static void addFlashGlobalWarn(FacesContext context, String message, Object... params)
-
addFlashGlobalError
public static void addFlashGlobalError(FacesContext context, String message, Object... params)
-
addFlashGlobalFatal
public static void addFlashGlobalFatal(FacesContext context, String message, Object... params)
-
isEmpty
public static boolean isEmpty(FacesContext context)
- See Also:
Messages.isEmpty()
-
isEmpty
public static boolean isEmpty(FacesContext context, String clientId)
- See Also:
Messages.isEmpty(String)
-
isGlobalEmpty
public static boolean isGlobalEmpty(FacesContext context)
- See Also:
Messages.isGlobalEmpty()
-
clear
public static boolean clear(FacesContext context, FacesMessage.Severity severity, String... clientIds)
-
clear
public static boolean clear(FacesContext context, String... clientIds)
- See Also:
Messages.clear(String...)
-
clearInfo
public static boolean clearInfo(FacesContext context, String... clientIds)
- See Also:
Messages.clearInfo(String...)
-
clearWarn
public static boolean clearWarn(FacesContext context, String... clientIds)
- See Also:
Messages.clearWarn(String...)
-
clearError
public static boolean clearError(FacesContext context, String... clientIds)
- See Also:
Messages.clearError(String...)
-
clearFatal
public static boolean clearFatal(FacesContext context, String... clientIds)
- See Also:
Messages.clearFatal(String...)
-
clearGlobal
public static boolean clearGlobal(FacesContext context, FacesMessage.Severity severity)
-
clearGlobal
public static boolean clearGlobal(FacesContext context)
- See Also:
Messages.clearGlobal()
-
clearGlobalInfo
public static boolean clearGlobalInfo(FacesContext context)
- See Also:
Messages.clearGlobalInfo()
-
clearGlobalWarn
public static boolean clearGlobalWarn(FacesContext context)
- See Also:
Messages.clearGlobalWarn()
-
clearGlobalError
public static boolean clearGlobalError(FacesContext context)
- See Also:
Messages.clearGlobalError()
-
clearGlobalFatal
public static boolean clearGlobalFatal(FacesContext context)
- See Also:
Messages.clearGlobalFatal()
-
-