Class FacesContextWrapper
- java.lang.Object
- 
- jakarta.faces.context.FacesContext
- 
- jakarta.faces.context.FacesContextWrapper
 
 
- 
- All Implemented Interfaces:
- FacesWrapper<FacesContext>
 
 public abstract class FacesContextWrapper extends FacesContext implements FacesWrapper<FacesContext> Provides a simple implementation of FacesContextthat can be subclassed by developers wishing to provide specialized behavior to an existingFacesContextinstance. The default implementation of all methods is to call through to the wrappedFacesContextinstance.Usage: extend this class and push the implementation being wrapped to the constructor and use getWrapped()to access the instance being wrapped.- Since:
- 2.0
 
- 
- 
Constructor SummaryConstructors Constructor Description FacesContextWrapper()Deprecated.Use the other constructor taking the implementation being wrapped.FacesContextWrapper(FacesContext wrapped)If this faces context has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMessage(String clientId, FacesMessage message)The default behavior of this method is to callFacesContext.addMessage(String, FacesMessage)on the wrappedFacesContextobject.ApplicationgetApplication()The default behavior of this method is to callFacesContext.getApplication()on the wrappedFacesContextobject.Map<Object,Object>getAttributes()The default behavior of this method is to callFacesContext.getAttributes()on the wrappedFacesContextobject.Iterator<String>getClientIdsWithMessages()The default behavior of this method is to callFacesContext.getClientIdsWithMessages()on the wrappedFacesContextobject.PhaseIdgetCurrentPhaseId()The default behavior of this method is to callFacesContext.getCurrentPhaseId()on the wrappedFacesContextobject.ELContextgetELContext()The default behavior of this method is to callFacesContext.getELContext()on the wrappedFacesContextobject.ExceptionHandlergetExceptionHandler()The default behavior of this method is to callFacesContext.getExceptionHandler()on the wrappedFacesContextobject.ExternalContextgetExternalContext()The default behavior of this method is to callFacesContext.getExternalContext()on the wrappedFacesContextobject.LifecyclegetLifecycle()The default behavior of this method is to callFacesContext.getLifecycle()on the wrappedFacesContextobject.FacesMessage.SeveritygetMaximumSeverity()The default behavior of this method is to callFacesContext.getMaximumSeverity()on the wrappedFacesContextobject.List<FacesMessage>getMessageList()The default behavior of this method is to callFacesContext.getMessageList()on the wrappedFacesContextobject.List<FacesMessage>getMessageList(String clientId)The default behavior of this method is to callFacesContext.getMessageList(String)on the wrappedFacesContextobject.Iterator<FacesMessage>getMessages()The default behavior of this method is to callFacesContext.getMessages()on the wrappedFacesContextobject.Iterator<FacesMessage>getMessages(String clientId)The default behavior of this method is to callFacesContext.getMessages(String)on the wrappedFacesContextobject.chargetNamingContainerSeparatorChar()The default behavior of this method is to callFacesContext.getNamingContainerSeparatorChar()on the wrappedFacesContextobject.PartialViewContextgetPartialViewContext()The default behavior of this method is to callFacesContext.getPartialViewContext()()} on the wrappedFacesContextobject.RenderKitgetRenderKit()The default behavior of this method is to callFacesContext.getRenderKit()on the wrappedFacesContextobject.booleangetRenderResponse()The default behavior of this method is to callFacesContext.getRenderResponse()on the wrappedFacesContextobject.List<String>getResourceLibraryContracts()The default behavior of this method is to callFacesContext.getResourceLibraryContracts()on the wrappedFacesContextobject.booleangetResponseComplete()The default behavior of this method is to callFacesContext.getResponseComplete()on the wrappedFacesContextobject.ResponseStreamgetResponseStream()The default behavior of this method is to callFacesContext.getResponseStream()on the wrappedFacesContextobject.ResponseWritergetResponseWriter()The default behavior of this method is to callFacesContext.getResponseWriter()on the wrappedFacesContextobject.UIViewRootgetViewRoot()The default behavior of this method is to callFacesContext.getViewRoot()on the wrappedFacesContextobject.FacesContextgetWrapped()A class that implements this interface uses this method to return an instance of the class being wrapped.booleanisPostback()The default behavior of this method is to callFacesContext.isPostback()on the wrappedFacesContextobject.booleanisProcessingEvents()The default behavior of this method is to callFacesContext.isProcessingEvents()on the wrappedFacesContextobject.booleanisProjectStage(ProjectStage stage)The default behavior of this method is to callFacesContext.isProjectStage(jakarta.faces.application.ProjectStage)on the wrappedFacesContextobject.booleanisReleased()The default behavior of this method is to callFacesContext.isReleased()on the wrappedFacesContextobject.booleanisValidationFailed()The default behavior of this method is to callFacesContext.isValidationFailed()on the wrappedFacesContextobject.voidrelease()The default behavior of this method is to callFacesContext.release()on the wrappedFacesContextobject.voidrenderResponse()The default behavior of this method is to callFacesContext.renderResponse()on the wrappedFacesContextobject.voidresponseComplete()The default behavior of this method is to callFacesContext.responseComplete()on the wrappedFacesContextobject.voidsetCurrentPhaseId(PhaseId currentPhaseId)The default behavior of this method is to callFacesContext.setCurrentPhaseId(PhaseId)on the wrappedFacesContextobject.voidsetExceptionHandler(ExceptionHandler exceptionHandler)The default behavior of this method is to callFacesContext.setExceptionHandler(ExceptionHandler)on the wrappedFacesContextobject.voidsetProcessingEvents(boolean processingEvents)The default behavior of this method is to callFacesContext.setProcessingEvents(boolean)on the wrappedFacesContextobject.voidsetResourceLibraryContracts(List<String> contracts)The default behavior of this method is to callFacesContext.setResourceLibraryContracts(java.util.List<java.lang.String>)on the wrappedFacesContextobject.voidsetResponseStream(ResponseStream responseStream)The default behavior of this method is to callFacesContext.setResponseStream(ResponseStream)on the wrappedFacesContextobject.voidsetResponseWriter(ResponseWriter responseWriter)The default behavior of this method is to callFacesContext.setResponseWriter(ResponseWriter)on the wrappedFacesContextobject.voidsetViewRoot(UIViewRoot root)The default behavior of this method is to callFacesContext.setViewRoot(UIViewRoot)on the wrappedFacesContextobject.voidvalidationFailed()The default behavior of this method is to callFacesContext.validationFailed()on the wrappedFacesContextobject.- 
Methods inherited from class jakarta.faces.context.FacesContextgetCurrentInstance, setCurrentInstance
 
- 
 
- 
- 
- 
Constructor Detail- 
FacesContextWrapper@Deprecated public FacesContextWrapper() Deprecated.Use the other constructor taking the implementation being wrapped.
 - 
FacesContextWrapperpublic FacesContextWrapper(FacesContext wrapped) If this faces context has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor. The getWrapped()will then return the implementation being wrapped.- Parameters:
- wrapped- The implementation being wrapped.
- Since:
- 2.3
 
 
- 
 - 
Method Detail- 
getWrappedpublic FacesContext getWrapped() Description copied from interface:FacesWrapperA class that implements this interface uses this method to return an instance of the class being wrapped. - Specified by:
- getWrappedin interface- FacesWrapper<FacesContext>
- Returns:
- the wrapped instance.
 
 - 
getLifecyclepublic Lifecycle getLifecycle() The default behavior of this method is to call FacesContext.getLifecycle()on the wrappedFacesContextobject.- Specified by:
- getLifecyclein class- FacesContext
- Returns:
- instance of Lifecycle
- See Also:
- FacesContext.getLifecycle()
 
 - 
getApplicationpublic Application getApplication() The default behavior of this method is to call FacesContext.getApplication()on the wrappedFacesContextobject.- Specified by:
- getApplicationin class- FacesContext
- Returns:
- the Applicationinstance associated with this web application.
- See Also:
- FacesContext.getApplication()
 
 - 
getClientIdsWithMessagespublic Iterator<String> getClientIdsWithMessages() The default behavior of this method is to call FacesContext.getClientIdsWithMessages()on the wrappedFacesContextobject.- Specified by:
- getClientIdsWithMessagesin class- FacesContext
- Returns:
- the Iteratorover the client identifiers for which at least oneFacesMessagehas been queued.
- See Also:
- FacesContext.getClientIdsWithMessages()
 
 - 
getExternalContextpublic ExternalContext getExternalContext() The default behavior of this method is to call FacesContext.getExternalContext()on the wrappedFacesContextobject.- Specified by:
- getExternalContextin class- FacesContext
- Returns:
- instance of ExternalContext
- See Also:
- FacesContext.getExternalContext()
 
 - 
getMaximumSeveritypublic FacesMessage.Severity getMaximumSeverity() The default behavior of this method is to call FacesContext.getMaximumSeverity()on the wrappedFacesContextobject.- Specified by:
- getMaximumSeverityin class- FacesContext
- Returns:
- the maximum severity level.
- See Also:
- FacesContext.getMaximumSeverity()
 
 - 
getMessagespublic Iterator<FacesMessage> getMessages() The default behavior of this method is to call FacesContext.getMessages()on the wrappedFacesContextobject.- Specified by:
- getMessagesin class- FacesContext
- Returns:
- Iteratorover the- FacesMessages that have been queued.
- See Also:
- FacesContext.getMessages()
 
 - 
getMessagespublic Iterator<FacesMessage> getMessages(String clientId) The default behavior of this method is to call FacesContext.getMessages(String)on the wrappedFacesContextobject.- Specified by:
- getMessagesin class- FacesContext
- Parameters:
- clientId- The client identifier for which messages are requested, or- nullfor messages not associated with any client identifier
- Returns:
- Iteratorover the- FacesMessages.
- See Also:
- FacesContext.getMessages(String)
 
 - 
getRenderKitpublic RenderKit getRenderKit() The default behavior of this method is to call FacesContext.getRenderKit()on the wrappedFacesContextobject.- Specified by:
- getRenderKitin class- FacesContext
- Returns:
- instance of RenderKitassociated with theUIViewRoot.
- See Also:
- FacesContext.getRenderKit()
 
 - 
getRenderResponsepublic boolean getRenderResponse() The default behavior of this method is to call FacesContext.getRenderResponse()on the wrappedFacesContextobject.- Specified by:
- getRenderResponsein class- FacesContext
- Returns:
- flag indicating whether the renderResponse()has been called.
- See Also:
- FacesContext.getRenderResponse()
 
 - 
getResourceLibraryContractspublic List<String> getResourceLibraryContracts() The default behavior of this method is to call FacesContext.getResourceLibraryContracts()on the wrappedFacesContextobject.- Overrides:
- getResourceLibraryContractsin class- FacesContext
- Returns:
- the list of resource library contracts.
- See Also:
- FacesContext.getResourceLibraryContracts()
 
 - 
setResourceLibraryContractspublic void setResourceLibraryContracts(List<String> contracts) The default behavior of this method is to call FacesContext.setResourceLibraryContracts(java.util.List<java.lang.String>)on the wrappedFacesContextobject.- Overrides:
- setResourceLibraryContractsin class- FacesContext
- Parameters:
- contracts- The new contracts to be returned, as an immutable- List. from a subsequent call to- FacesContext.getResourceLibraryContracts().
- See Also:
- FacesContext.setResourceLibraryContracts(java.util.List<java.lang.String>)
 
 - 
getResponseCompletepublic boolean getResponseComplete() The default behavior of this method is to call FacesContext.getResponseComplete()on the wrappedFacesContextobject.- Specified by:
- getResponseCompletein class- FacesContext
- Returns:
- the boolean indicating whether responseComplete()method has been called.
- See Also:
- FacesContext.getResponseComplete()
 
 - 
getResponseStreampublic ResponseStream getResponseStream() The default behavior of this method is to call FacesContext.getResponseStream()on the wrappedFacesContextobject.- Specified by:
- getResponseStreamin class- FacesContext
- Returns:
- ResponseStreaminstance.
- See Also:
- FacesContext.getResponseStream()
 
 - 
setResponseStreampublic void setResponseStream(ResponseStream responseStream) The default behavior of this method is to call FacesContext.setResponseStream(ResponseStream)on the wrappedFacesContextobject.- Specified by:
- setResponseStreamin class- FacesContext
- Parameters:
- responseStream- The new ResponseStream for this response
- See Also:
- FacesContext.setResponseStream(ResponseStream)
 
 - 
getResponseWriterpublic ResponseWriter getResponseWriter() The default behavior of this method is to call FacesContext.getResponseWriter()on the wrappedFacesContextobject.- Specified by:
- getResponseWriterin class- FacesContext
- Returns:
- ResponseWriterinstance.
- See Also:
- FacesContext.getResponseWriter()
 
 - 
setResponseWriterpublic void setResponseWriter(ResponseWriter responseWriter) The default behavior of this method is to call FacesContext.setResponseWriter(ResponseWriter)on the wrappedFacesContextobject.- Specified by:
- setResponseWriterin class- FacesContext
- Parameters:
- responseWriter- The new ResponseWriter for this response
- See Also:
- FacesContext.setResponseWriter(ResponseWriter)
 
 - 
getViewRootpublic UIViewRoot getViewRoot() The default behavior of this method is to call FacesContext.getViewRoot()on the wrappedFacesContextobject.- Specified by:
- getViewRootin class- FacesContext
- Returns:
- UIViewRootinstance.
- See Also:
- FacesContext.getViewRoot()
 
 - 
setViewRootpublic void setViewRoot(UIViewRoot root) The default behavior of this method is to call FacesContext.setViewRoot(UIViewRoot)on the wrappedFacesContextobject.- Specified by:
- setViewRootin class- FacesContext
- Parameters:
- root- The new component- UIViewRootcomponent
- See Also:
- FacesContext.setViewRoot(UIViewRoot)
 
 - 
addMessagepublic void addMessage(String clientId, FacesMessage message) The default behavior of this method is to call FacesContext.addMessage(String, FacesMessage)on the wrappedFacesContextobject.- Specified by:
- addMessagein class- FacesContext
- Parameters:
- clientId- The client identifier with which this message is associated (if any)
- message- The message to be appended
- See Also:
- FacesContext.addMessage(String, FacesMessage)
 
 - 
isReleasedpublic boolean isReleased() The default behavior of this method is to call FacesContext.isReleased()on the wrappedFacesContextobject.- Overrides:
- isReleasedin class- FacesContext
- Returns:
- trueif the resources have been released.
- Since:
- 2.1
- See Also:
- FacesContext.isReleased()
 
 - 
releasepublic void release() The default behavior of this method is to call FacesContext.release()on the wrappedFacesContextobject.- Specified by:
- releasein class- FacesContext
- See Also:
- FacesContext.release()
 
 - 
renderResponsepublic void renderResponse() The default behavior of this method is to call FacesContext.renderResponse()on the wrappedFacesContextobject.- Specified by:
- renderResponsein class- FacesContext
- See Also:
- FacesContext.renderResponse()
 
 - 
responseCompletepublic void responseComplete() The default behavior of this method is to call FacesContext.responseComplete()on the wrappedFacesContextobject.- Specified by:
- responseCompletein class- FacesContext
- See Also:
- FacesContext.responseComplete()
 
 - 
getAttributespublic Map<Object,Object> getAttributes() The default behavior of this method is to call FacesContext.getAttributes()on the wrappedFacesContextobject.- Overrides:
- getAttributesin class- FacesContext
- Returns:
- mutable Maprepresenting the attributes associated wth thisFacesContextinstance.
- See Also:
- FacesContext.getAttributes()
 
 - 
getNamingContainerSeparatorCharpublic char getNamingContainerSeparatorChar() The default behavior of this method is to call FacesContext.getNamingContainerSeparatorChar()on the wrappedFacesContextobject.- Overrides:
- getNamingContainerSeparatorCharin class- FacesContext
- Returns:
- the separator char.
- See Also:
- FacesContext.getNamingContainerSeparatorChar()
 
 - 
getPartialViewContextpublic PartialViewContext getPartialViewContext() The default behavior of this method is to call FacesContext.getPartialViewContext()()} on the wrappedFacesContextobject.- Overrides:
- getPartialViewContextin class- FacesContext
- Returns:
- the instance of PartialViewContextfor this request.
- See Also:
- FacesContext.getPartialViewContext()
 
 - 
getELContextpublic ELContext getELContext() The default behavior of this method is to call FacesContext.getELContext()on the wrappedFacesContextobject.- Overrides:
- getELContextin class- FacesContext
- Returns:
- instance of ELContext.
- See Also:
- FacesContext.getELContext()
 
 - 
getExceptionHandlerpublic ExceptionHandler getExceptionHandler() The default behavior of this method is to call FacesContext.getExceptionHandler()on the wrappedFacesContextobject.- Overrides:
- getExceptionHandlerin class- FacesContext
- Returns:
- instance of ExceptionHandler.
- See Also:
- FacesContext.getExceptionHandler()
 
 - 
setExceptionHandlerpublic void setExceptionHandler(ExceptionHandler exceptionHandler) The default behavior of this method is to call FacesContext.setExceptionHandler(ExceptionHandler)on the wrappedFacesContextobject.- Overrides:
- setExceptionHandlerin class- FacesContext
- Parameters:
- exceptionHandler- the- ExceptionHandlerfor this request.
- See Also:
- FacesContext.setExceptionHandler(ExceptionHandler)
 
 - 
getMessageListpublic List<FacesMessage> getMessageList() The default behavior of this method is to call FacesContext.getMessageList()on the wrappedFacesContextobject.- Overrides:
- getMessageListin class- FacesContext
- Returns:
- an immutable Listwhich is effectively a snapshot of the messages present at the time of invocation.
- See Also:
- FacesContext.getMessageList()
 
 - 
getMessageListpublic List<FacesMessage> getMessageList(String clientId) The default behavior of this method is to call FacesContext.getMessageList(String)on the wrappedFacesContextobject.- Overrides:
- getMessageListin class- FacesContext
- Parameters:
- clientId- the client id of a component.
- Returns:
- an immutable Listwhich is effectively a snapshot of the messages present at the time of invocation.
- See Also:
- FacesContext.getMessageList(String)
 
 - 
isPostbackpublic boolean isPostback() The default behavior of this method is to call FacesContext.isPostback()on the wrappedFacesContextobject.- Overrides:
- isPostbackin class- FacesContext
- Returns:
- the boolean indicating whether this request is a post one.
- See Also:
- FacesContext.isPostback()
 
 - 
getCurrentPhaseIdpublic PhaseId getCurrentPhaseId() The default behavior of this method is to call FacesContext.getCurrentPhaseId()on the wrappedFacesContextobject.- Overrides:
- getCurrentPhaseIdin class- FacesContext
- Returns:
- the current phase id.
- See Also:
- FacesContext.getCurrentPhaseId()
 
 - 
setCurrentPhaseIdpublic void setCurrentPhaseId(PhaseId currentPhaseId) The default behavior of this method is to call FacesContext.setCurrentPhaseId(PhaseId)on the wrappedFacesContextobject.- Overrides:
- setCurrentPhaseIdin class- FacesContext
- Parameters:
- currentPhaseId- The- PhaseIdfor the current phase.
- See Also:
- FacesContext.setCurrentPhaseId(PhaseId)
 
 - 
isValidationFailedpublic boolean isValidationFailed() The default behavior of this method is to call FacesContext.isValidationFailed()on the wrappedFacesContextobject.- Overrides:
- isValidationFailedin class- FacesContext
- Returns:
- boolean indicating if the validationFailed()method has been called for the current request
- See Also:
- FacesContext.isValidationFailed()
 
 - 
validationFailedpublic void validationFailed() The default behavior of this method is to call FacesContext.validationFailed()on the wrappedFacesContextobject.- Overrides:
- validationFailedin class- FacesContext
- See Also:
- FacesContext.validationFailed()
 
 - 
setProcessingEventspublic void setProcessingEvents(boolean processingEvents) The default behavior of this method is to call FacesContext.setProcessingEvents(boolean)on the wrappedFacesContextobject.- Overrides:
- setProcessingEventsin class- FacesContext
- Parameters:
- processingEvents- flag indicating events should be processed or not
- See Also:
- FacesContext.setProcessingEvents(boolean)
 
 - 
isProcessingEventspublic boolean isProcessingEvents() The default behavior of this method is to call FacesContext.isProcessingEvents()on the wrappedFacesContextobject.- Overrides:
- isProcessingEventsin class- FacesContext
- Returns:
- trueif events should be published, otherwise- false
- See Also:
- FacesContext.isProcessingEvents()
 
 - 
isProjectStagepublic boolean isProjectStage(ProjectStage stage) The default behavior of this method is to call FacesContext.isProjectStage(jakarta.faces.application.ProjectStage)on the wrappedFacesContextobject.- Overrides:
- isProjectStagein class- FacesContext
- Parameters:
- stage- the- ProjectStageto check
- Returns:
- boolean indicating whether the application has the same stage.
- See Also:
- FacesContext.isProjectStage(jakarta.faces.application.ProjectStage)
 
 
- 
 
-