Class FacesContextWrapper
- All Implemented Interfaces:
FacesWrapper<FacesContext>
- Since:
- 2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMessage
(String clientId, FacesMessage message) jakarta.el.ELContext
Return the context within which all EL-expressions are evaluated.getMessageList
(String clientId) getMessages
(String clientId) char
Return the PartialViewContext for this request.boolean
boolean
A class that implements this interface uses this method to return an instance of the class being wrapped.boolean
boolean
boolean
isProjectStage
(ProjectStage stage) boolean
boolean
void
release()
void
void
void
setCurrentPhaseId
(PhaseId currentPhaseId) void
setExceptionHandler
(ExceptionHandler exceptionHandler) void
setProcessingEvents
(boolean processingEvents) void
setResourceLibraryContracts
(List<String> contracts) void
setResponseStream
(ResponseStream responseStream) void
setResponseWriter
(ResponseWriter responseWriter) void
setViewRoot
(UIViewRoot root) void
Methods inherited from class jakarta.faces.context.FacesContext
getCurrentInstance, setCurrentInstance
-
Constructor Details
-
FacesContextWrapper
Deprecated. -
FacesContextWrapper
-
-
Method Details
-
addMessage
- Specified by:
addMessage
in classFacesContext
-
getApplication
- Specified by:
getApplication
in classFacesContext
-
getAttributes
- Overrides:
getAttributes
in classFacesContext
- Returns:
-
getClientIdsWithMessages
- Specified by:
getClientIdsWithMessages
in classFacesContext
-
getCurrentPhaseId
- Overrides:
getCurrentPhaseId
in classFacesContext
- Returns:
-
getELContext
public jakarta.el.ELContext getELContext()Description copied from class:FacesContext
Return the context within which all EL-expressions are evaluated.A Faces implementation is expected to provide a full implementation of this class. However Faces also explicitly allows user code to apply the "decorator" pattern to this type, by overriding the FacesContextFactory class. In that pattern, the decorating class has a reference to an "underlying" implementation and forward calls to it, possibly after taking other related actions.
The decorator pattern does have difficulties with backwards-compatibility when new methods are added to the class being decorated, as with this method which was added in Faces1.2. Decorator classes that were written for Faces1.1 will subclass this class, but will not override this method to pass the call on to the "underlying" instance. This base implementation therefore must do that for it.
Unfortunately the Faces designers stuffed up the design; this base class has no way of knowing what the "underlying" instance is! The current implementation here is therefore to delegate directly to the very first FacesContext instance registered within this request (via setCurrentInstance). This instance should be the "full" implementation provided by the Faces framework. The drawback is that when any decorator class is present which defaults to this base implementation, then any following decorator instances that do override this method do not get it invoked.
It is believed that the Sun Faces implementation (Mojarra) does something similar.
- Overrides:
getELContext
in classFacesContext
-
getExceptionHandler
- Overrides:
getExceptionHandler
in classFacesContext
- Returns:
-
getExternalContext
- Specified by:
getExternalContext
in classFacesContext
-
getMaximumSeverity
- Specified by:
getMaximumSeverity
in classFacesContext
-
getMessageList
- Overrides:
getMessageList
in classFacesContext
- Returns:
-
getMessageList
- Overrides:
getMessageList
in classFacesContext
- Returns:
-
getMessages
- Specified by:
getMessages
in classFacesContext
-
getMessages
- Specified by:
getMessages
in classFacesContext
-
getPartialViewContext
Description copied from class:FacesContext
Return the PartialViewContext for this request. The PartialViewContext is used to control the processing of specified components during the execute portion of the request processing lifecycle (known as partial processing) and the rendering of specified components (known as partial rendering). This method must return a new PartialViewContext if one does not already exist.
- Overrides:
getPartialViewContext
in classFacesContext
- Returns:
- The PartialViewContext
-
getRenderKit
- Specified by:
getRenderKit
in classFacesContext
-
getRenderResponse
public boolean getRenderResponse()- Specified by:
getRenderResponse
in classFacesContext
-
getResponseComplete
public boolean getResponseComplete()- Specified by:
getResponseComplete
in classFacesContext
-
getResponseStream
- Specified by:
getResponseStream
in classFacesContext
-
getResponseWriter
- Specified by:
getResponseWriter
in classFacesContext
-
isValidationFailed
public boolean isValidationFailed()- Overrides:
isValidationFailed
in classFacesContext
- Returns:
-
getViewRoot
- Specified by:
getViewRoot
in classFacesContext
-
getWrapped
Description copied from interface:FacesWrapper
A class that implements this interface uses this method to return an instance of the class being wrapped.- Specified by:
getWrapped
in interfaceFacesWrapper<FacesContext>
- Returns:
- the instance of the class being wrapped
-
isPostback
public boolean isPostback()- Overrides:
isPostback
in classFacesContext
- Returns:
-
isProcessingEvents
public boolean isProcessingEvents()- Overrides:
isProcessingEvents
in classFacesContext
- Returns:
-
release
public void release()- Specified by:
release
in classFacesContext
-
renderResponse
public void renderResponse()- Specified by:
renderResponse
in classFacesContext
-
responseComplete
public void responseComplete()- Specified by:
responseComplete
in classFacesContext
-
setCurrentPhaseId
- Overrides:
setCurrentPhaseId
in classFacesContext
-
setExceptionHandler
- Overrides:
setExceptionHandler
in classFacesContext
-
setProcessingEvents
public void setProcessingEvents(boolean processingEvents) - Overrides:
setProcessingEvents
in classFacesContext
-
setResponseStream
- Specified by:
setResponseStream
in classFacesContext
-
setResponseWriter
- Specified by:
setResponseWriter
in classFacesContext
-
setViewRoot
- Specified by:
setViewRoot
in classFacesContext
-
validationFailed
public void validationFailed()- Overrides:
validationFailed
in classFacesContext
-
isProjectStage
- Overrides:
isProjectStage
in classFacesContext
-
isReleased
public boolean isReleased()- Overrides:
isReleased
in classFacesContext
- Returns:
-
getNamingContainerSeparatorChar
public char getNamingContainerSeparatorChar()- Overrides:
getNamingContainerSeparatorChar
in classFacesContext
- Returns:
-
setResourceLibraryContracts
- Overrides:
setResourceLibraryContracts
in classFacesContext
-
getResourceLibraryContracts
- Overrides:
getResourceLibraryContracts
in classFacesContext
- Returns:
-
getLifecycle
- Specified by:
getLifecycle
in classFacesContext
- Returns:
- Since:
- 4.0
-