public interface JsfMessage<T> extends Serializable
An injectable component for typesafe FacesMessages.
T must be a class which is annotated with
MessageBundle
Usage:
@Inject JsfMessage<MyMessages> msg; ... msg.addError().userNotLoggedIn(user);
MessageBundle methods which are used as JsfMessage can return a
Message
or a String.
In case of a String we use it for both the summary and detail
information on the FacesMessage.
If a Message is returned, we lookup the 'detail' and 'summary'
categories (see Message.toString(String)
for creating the FacesMessage.
Modifier and Type | Field and Description |
---|---|
static String |
CATEGORY_DETAIL |
static String |
CATEGORY_SUMMARY |
Modifier and Type | Method and Description |
---|---|
T |
addError() |
T |
addFatal() |
T |
addInfo() |
T |
addWarn() |
JsfMessage<T> |
forClientId(String clientId)
If the JsfMessage is used in a UIComponent we allow to set the clientId
|
JsfMessage<T> |
forComponent(javax.faces.component.UIComponent uiComponent) |
T |
get() |
static final String CATEGORY_DETAIL
static final String CATEGORY_SUMMARY
JsfMessage<T> forClientId(String clientId)
clientId
- JsfMessage<T> forComponent(javax.faces.component.UIComponent uiComponent)
uiComponent
- T addError()
T addFatal()
T addInfo()
T addWarn()
T get()
Copyright © 2015 The Apache Software Foundation. All rights reserved.