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
FacesContext
that can be subclassed by developers wishing to provide specialized behavior to an existingFacesContext
instance. The default implementation of all methods is to call through to the wrappedFacesContext
instance.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 Summary
Constructors 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMessage(String clientId, FacesMessage message)
The default behavior of this method is to callFacesContext.addMessage(String, FacesMessage)
on the wrappedFacesContext
object.Application
getApplication()
The default behavior of this method is to callFacesContext.getApplication()
on the wrappedFacesContext
object.Map<Object,Object>
getAttributes()
The default behavior of this method is to callFacesContext.getAttributes()
on the wrappedFacesContext
object.Iterator<String>
getClientIdsWithMessages()
The default behavior of this method is to callFacesContext.getClientIdsWithMessages()
on the wrappedFacesContext
object.PhaseId
getCurrentPhaseId()
The default behavior of this method is to callFacesContext.getCurrentPhaseId()
on the wrappedFacesContext
object.ELContext
getELContext()
The default behavior of this method is to callFacesContext.getELContext()
on the wrappedFacesContext
object.ExceptionHandler
getExceptionHandler()
The default behavior of this method is to callFacesContext.getExceptionHandler()
on the wrappedFacesContext
object.ExternalContext
getExternalContext()
The default behavior of this method is to callFacesContext.getExternalContext()
on the wrappedFacesContext
object.Lifecycle
getLifecycle()
The default behavior of this method is to callFacesContext.getLifecycle()
on the wrappedFacesContext
object.FacesMessage.Severity
getMaximumSeverity()
The default behavior of this method is to callFacesContext.getMaximumSeverity()
on the wrappedFacesContext
object.List<FacesMessage>
getMessageList()
The default behavior of this method is to callFacesContext.getMessageList()
on the wrappedFacesContext
object.List<FacesMessage>
getMessageList(String clientId)
The default behavior of this method is to callFacesContext.getMessageList(String)
on the wrappedFacesContext
object.Iterator<FacesMessage>
getMessages()
The default behavior of this method is to callFacesContext.getMessages()
on the wrappedFacesContext
object.Iterator<FacesMessage>
getMessages(String clientId)
The default behavior of this method is to callFacesContext.getMessages(String)
on the wrappedFacesContext
object.char
getNamingContainerSeparatorChar()
The default behavior of this method is to callFacesContext.getNamingContainerSeparatorChar()
on the wrappedFacesContext
object.PartialViewContext
getPartialViewContext()
The default behavior of this method is to callFacesContext.getPartialViewContext()
()} on the wrappedFacesContext
object.RenderKit
getRenderKit()
The default behavior of this method is to callFacesContext.getRenderKit()
on the wrappedFacesContext
object.boolean
getRenderResponse()
The default behavior of this method is to callFacesContext.getRenderResponse()
on the wrappedFacesContext
object.List<String>
getResourceLibraryContracts()
The default behavior of this method is to callFacesContext.getResourceLibraryContracts()
on the wrappedFacesContext
object.boolean
getResponseComplete()
The default behavior of this method is to callFacesContext.getResponseComplete()
on the wrappedFacesContext
object.ResponseStream
getResponseStream()
The default behavior of this method is to callFacesContext.getResponseStream()
on the wrappedFacesContext
object.ResponseWriter
getResponseWriter()
The default behavior of this method is to callFacesContext.getResponseWriter()
on the wrappedFacesContext
object.UIViewRoot
getViewRoot()
The default behavior of this method is to callFacesContext.getViewRoot()
on the wrappedFacesContext
object.FacesContext
getWrapped()
A class that implements this interface uses this method to return an instance of the class being wrapped.boolean
isPostback()
The default behavior of this method is to callFacesContext.isPostback()
on the wrappedFacesContext
object.boolean
isProcessingEvents()
The default behavior of this method is to callFacesContext.isProcessingEvents()
on the wrappedFacesContext
object.boolean
isProjectStage(ProjectStage stage)
The default behavior of this method is to callFacesContext.isProjectStage(jakarta.faces.application.ProjectStage)
on the wrappedFacesContext
object.boolean
isReleased()
The default behavior of this method is to callFacesContext.isReleased()
on the wrappedFacesContext
object.boolean
isValidationFailed()
The default behavior of this method is to callFacesContext.isValidationFailed()
on the wrappedFacesContext
object.void
release()
The default behavior of this method is to callFacesContext.release()
on the wrappedFacesContext
object.void
renderResponse()
The default behavior of this method is to callFacesContext.renderResponse()
on the wrappedFacesContext
object.void
responseComplete()
The default behavior of this method is to callFacesContext.responseComplete()
on the wrappedFacesContext
object.void
setCurrentPhaseId(PhaseId currentPhaseId)
The default behavior of this method is to callFacesContext.setCurrentPhaseId(PhaseId)
on the wrappedFacesContext
object.void
setExceptionHandler(ExceptionHandler exceptionHandler)
The default behavior of this method is to callFacesContext.setExceptionHandler(ExceptionHandler)
on the wrappedFacesContext
object.void
setProcessingEvents(boolean processingEvents)
The default behavior of this method is to callFacesContext.setProcessingEvents(boolean)
on the wrappedFacesContext
object.void
setResourceLibraryContracts(List<String> contracts)
The default behavior of this method is to callFacesContext.setResourceLibraryContracts(java.util.List<java.lang.String>)
on the wrappedFacesContext
object.void
setResponseStream(ResponseStream responseStream)
The default behavior of this method is to callFacesContext.setResponseStream(ResponseStream)
on the wrappedFacesContext
object.void
setResponseWriter(ResponseWriter responseWriter)
The default behavior of this method is to callFacesContext.setResponseWriter(ResponseWriter)
on the wrappedFacesContext
object.void
setViewRoot(UIViewRoot root)
The default behavior of this method is to callFacesContext.setViewRoot(UIViewRoot)
on the wrappedFacesContext
object.void
validationFailed()
The default behavior of this method is to callFacesContext.validationFailed()
on the wrappedFacesContext
object.-
Methods inherited from class jakarta.faces.context.FacesContext
getCurrentInstance, setCurrentInstance
-
-
-
-
Constructor Detail
-
FacesContextWrapper
@Deprecated public FacesContextWrapper()
Deprecated.Use the other constructor taking the implementation being wrapped.
-
FacesContextWrapper
public 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
-
getWrapped
public FacesContext 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 wrapped instance.
-
getLifecycle
public Lifecycle getLifecycle()
The default behavior of this method is to call
FacesContext.getLifecycle()
on the wrappedFacesContext
object.- Specified by:
getLifecycle
in classFacesContext
- Returns:
- instance of
Lifecycle
- See Also:
FacesContext.getLifecycle()
-
getApplication
public Application getApplication()
The default behavior of this method is to call
FacesContext.getApplication()
on the wrappedFacesContext
object.- Specified by:
getApplication
in classFacesContext
- Returns:
- the
Application
instance associated with this web application. - See Also:
FacesContext.getApplication()
-
getClientIdsWithMessages
public Iterator<String> getClientIdsWithMessages()
The default behavior of this method is to call
FacesContext.getClientIdsWithMessages()
on the wrappedFacesContext
object.- Specified by:
getClientIdsWithMessages
in classFacesContext
- Returns:
- the
Iterator
over the client identifiers for which at least oneFacesMessage
has been queued. - See Also:
FacesContext.getClientIdsWithMessages()
-
getExternalContext
public ExternalContext getExternalContext()
The default behavior of this method is to call
FacesContext.getExternalContext()
on the wrappedFacesContext
object.- Specified by:
getExternalContext
in classFacesContext
- Returns:
- instance of
ExternalContext
- See Also:
FacesContext.getExternalContext()
-
getMaximumSeverity
public FacesMessage.Severity getMaximumSeverity()
The default behavior of this method is to call
FacesContext.getMaximumSeverity()
on the wrappedFacesContext
object.- Specified by:
getMaximumSeverity
in classFacesContext
- Returns:
- the maximum severity level.
- See Also:
FacesContext.getMaximumSeverity()
-
getMessages
public Iterator<FacesMessage> getMessages()
The default behavior of this method is to call
FacesContext.getMessages()
on the wrappedFacesContext
object.- Specified by:
getMessages
in classFacesContext
- Returns:
Iterator
over theFacesMessage
s that have been queued.- See Also:
FacesContext.getMessages()
-
getMessages
public Iterator<FacesMessage> getMessages(String clientId)
The default behavior of this method is to call
FacesContext.getMessages(String)
on the wrappedFacesContext
object.- Specified by:
getMessages
in classFacesContext
- Parameters:
clientId
- The client identifier for which messages are requested, ornull
for messages not associated with any client identifier- Returns:
Iterator
over theFacesMessage
s.- See Also:
FacesContext.getMessages(String)
-
getRenderKit
public RenderKit getRenderKit()
The default behavior of this method is to call
FacesContext.getRenderKit()
on the wrappedFacesContext
object.- Specified by:
getRenderKit
in classFacesContext
- Returns:
- instance of
RenderKit
associated with theUIViewRoot
. - See Also:
FacesContext.getRenderKit()
-
getRenderResponse
public boolean getRenderResponse()
The default behavior of this method is to call
FacesContext.getRenderResponse()
on the wrappedFacesContext
object.- Specified by:
getRenderResponse
in classFacesContext
- Returns:
- flag indicating whether the
renderResponse()
has been called. - See Also:
FacesContext.getRenderResponse()
-
getResourceLibraryContracts
public List<String> getResourceLibraryContracts()
The default behavior of this method is to call
FacesContext.getResourceLibraryContracts()
on the wrappedFacesContext
object.- Overrides:
getResourceLibraryContracts
in classFacesContext
- Returns:
- the list of resource library contracts.
- See Also:
FacesContext.getResourceLibraryContracts()
-
setResourceLibraryContracts
public void setResourceLibraryContracts(List<String> contracts)
The default behavior of this method is to call
FacesContext.setResourceLibraryContracts(java.util.List<java.lang.String>)
on the wrappedFacesContext
object.- Overrides:
setResourceLibraryContracts
in classFacesContext
- Parameters:
contracts
- The new contracts to be returned, as an immutableList
. from a subsequent call toFacesContext.getResourceLibraryContracts()
.- See Also:
FacesContext.setResourceLibraryContracts(java.util.List<java.lang.String>)
-
getResponseComplete
public boolean getResponseComplete()
The default behavior of this method is to call
FacesContext.getResponseComplete()
on the wrappedFacesContext
object.- Specified by:
getResponseComplete
in classFacesContext
- Returns:
- the boolean indicating whether
responseComplete()
method has been called. - See Also:
FacesContext.getResponseComplete()
-
getResponseStream
public ResponseStream getResponseStream()
The default behavior of this method is to call
FacesContext.getResponseStream()
on the wrappedFacesContext
object.- Specified by:
getResponseStream
in classFacesContext
- Returns:
ResponseStream
instance.- See Also:
FacesContext.getResponseStream()
-
setResponseStream
public void setResponseStream(ResponseStream responseStream)
The default behavior of this method is to call
FacesContext.setResponseStream(ResponseStream)
on the wrappedFacesContext
object.- Specified by:
setResponseStream
in classFacesContext
- Parameters:
responseStream
- The new ResponseStream for this response- See Also:
FacesContext.setResponseStream(ResponseStream)
-
getResponseWriter
public ResponseWriter getResponseWriter()
The default behavior of this method is to call
FacesContext.getResponseWriter()
on the wrappedFacesContext
object.- Specified by:
getResponseWriter
in classFacesContext
- Returns:
ResponseWriter
instance.- See Also:
FacesContext.getResponseWriter()
-
setResponseWriter
public void setResponseWriter(ResponseWriter responseWriter)
The default behavior of this method is to call
FacesContext.setResponseWriter(ResponseWriter)
on the wrappedFacesContext
object.- Specified by:
setResponseWriter
in classFacesContext
- Parameters:
responseWriter
- The new ResponseWriter for this response- See Also:
FacesContext.setResponseWriter(ResponseWriter)
-
getViewRoot
public UIViewRoot getViewRoot()
The default behavior of this method is to call
FacesContext.getViewRoot()
on the wrappedFacesContext
object.- Specified by:
getViewRoot
in classFacesContext
- Returns:
UIViewRoot
instance.- See Also:
FacesContext.getViewRoot()
-
setViewRoot
public void setViewRoot(UIViewRoot root)
The default behavior of this method is to call
FacesContext.setViewRoot(UIViewRoot)
on the wrappedFacesContext
object.- Specified by:
setViewRoot
in classFacesContext
- Parameters:
root
- The new componentUIViewRoot
component- See Also:
FacesContext.setViewRoot(UIViewRoot)
-
addMessage
public void addMessage(String clientId, FacesMessage message)
The default behavior of this method is to call
FacesContext.addMessage(String, FacesMessage)
on the wrappedFacesContext
object.- Specified by:
addMessage
in classFacesContext
- 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)
-
isReleased
public boolean isReleased()
The default behavior of this method is to call
FacesContext.isReleased()
on the wrappedFacesContext
object.- Overrides:
isReleased
in classFacesContext
- Returns:
true
if the resources have been released.- Since:
- 2.1
- See Also:
FacesContext.isReleased()
-
release
public void release()
The default behavior of this method is to call
FacesContext.release()
on the wrappedFacesContext
object.- Specified by:
release
in classFacesContext
- See Also:
FacesContext.release()
-
renderResponse
public void renderResponse()
The default behavior of this method is to call
FacesContext.renderResponse()
on the wrappedFacesContext
object.- Specified by:
renderResponse
in classFacesContext
- See Also:
FacesContext.renderResponse()
-
responseComplete
public void responseComplete()
The default behavior of this method is to call
FacesContext.responseComplete()
on the wrappedFacesContext
object.- Specified by:
responseComplete
in classFacesContext
- See Also:
FacesContext.responseComplete()
-
getAttributes
public Map<Object,Object> getAttributes()
The default behavior of this method is to call
FacesContext.getAttributes()
on the wrappedFacesContext
object.- Overrides:
getAttributes
in classFacesContext
- Returns:
- mutable
Map
representing the attributes associated wth thisFacesContext
instance. - See Also:
FacesContext.getAttributes()
-
getNamingContainerSeparatorChar
public char getNamingContainerSeparatorChar()
The default behavior of this method is to call
FacesContext.getNamingContainerSeparatorChar()
on the wrappedFacesContext
object.- Overrides:
getNamingContainerSeparatorChar
in classFacesContext
- Returns:
- the separator char.
- See Also:
FacesContext.getNamingContainerSeparatorChar()
-
getPartialViewContext
public PartialViewContext getPartialViewContext()
The default behavior of this method is to call
FacesContext.getPartialViewContext()
()} on the wrappedFacesContext
object.- Overrides:
getPartialViewContext
in classFacesContext
- Returns:
- the instance of
PartialViewContext
for this request. - See Also:
FacesContext.getPartialViewContext()
-
getELContext
public ELContext getELContext()
The default behavior of this method is to call
FacesContext.getELContext()
on the wrappedFacesContext
object.- Overrides:
getELContext
in classFacesContext
- Returns:
- instance of
ELContext
. - See Also:
FacesContext.getELContext()
-
getExceptionHandler
public ExceptionHandler getExceptionHandler()
The default behavior of this method is to call
FacesContext.getExceptionHandler()
on the wrappedFacesContext
object.- Overrides:
getExceptionHandler
in classFacesContext
- Returns:
- instance of
ExceptionHandler
. - See Also:
FacesContext.getExceptionHandler()
-
setExceptionHandler
public void setExceptionHandler(ExceptionHandler exceptionHandler)
The default behavior of this method is to call
FacesContext.setExceptionHandler(ExceptionHandler)
on the wrappedFacesContext
object.- Overrides:
setExceptionHandler
in classFacesContext
- Parameters:
exceptionHandler
- theExceptionHandler
for this request.- See Also:
FacesContext.setExceptionHandler(ExceptionHandler)
-
getMessageList
public List<FacesMessage> getMessageList()
The default behavior of this method is to call
FacesContext.getMessageList()
on the wrappedFacesContext
object.- Overrides:
getMessageList
in classFacesContext
- Returns:
- an immutable
List
which is effectively a snapshot of the messages present at the time of invocation. - See Also:
FacesContext.getMessageList()
-
getMessageList
public List<FacesMessage> getMessageList(String clientId)
The default behavior of this method is to call
FacesContext.getMessageList(String)
on the wrappedFacesContext
object.- Overrides:
getMessageList
in classFacesContext
- Parameters:
clientId
- the client id of a component.- Returns:
- an immutable
List
which is effectively a snapshot of the messages present at the time of invocation. - See Also:
FacesContext.getMessageList(String)
-
isPostback
public boolean isPostback()
The default behavior of this method is to call
FacesContext.isPostback()
on the wrappedFacesContext
object.- Overrides:
isPostback
in classFacesContext
- Returns:
- the boolean indicating whether this request is a post one.
- See Also:
FacesContext.isPostback()
-
getCurrentPhaseId
public PhaseId getCurrentPhaseId()
The default behavior of this method is to call
FacesContext.getCurrentPhaseId()
on the wrappedFacesContext
object.- Overrides:
getCurrentPhaseId
in classFacesContext
- Returns:
- the current phase id.
- See Also:
FacesContext.getCurrentPhaseId()
-
setCurrentPhaseId
public void setCurrentPhaseId(PhaseId currentPhaseId)
The default behavior of this method is to call
FacesContext.setCurrentPhaseId(PhaseId)
on the wrappedFacesContext
object.- Overrides:
setCurrentPhaseId
in classFacesContext
- Parameters:
currentPhaseId
- ThePhaseId
for the current phase.- See Also:
FacesContext.setCurrentPhaseId(PhaseId)
-
isValidationFailed
public boolean isValidationFailed()
The default behavior of this method is to call
FacesContext.isValidationFailed()
on the wrappedFacesContext
object.- Overrides:
isValidationFailed
in classFacesContext
- Returns:
- boolean indicating if the
validationFailed()
method has been called for the current request - See Also:
FacesContext.isValidationFailed()
-
validationFailed
public void validationFailed()
The default behavior of this method is to call
FacesContext.validationFailed()
on the wrappedFacesContext
object.- Overrides:
validationFailed
in classFacesContext
- See Also:
FacesContext.validationFailed()
-
setProcessingEvents
public void setProcessingEvents(boolean processingEvents)
The default behavior of this method is to call
FacesContext.setProcessingEvents(boolean)
on the wrappedFacesContext
object.- Overrides:
setProcessingEvents
in classFacesContext
- Parameters:
processingEvents
- flag indicating events should be processed or not- See Also:
FacesContext.setProcessingEvents(boolean)
-
isProcessingEvents
public boolean isProcessingEvents()
The default behavior of this method is to call
FacesContext.isProcessingEvents()
on the wrappedFacesContext
object.- Overrides:
isProcessingEvents
in classFacesContext
- Returns:
true
if events should be published, otherwisefalse
- See Also:
FacesContext.isProcessingEvents()
-
isProjectStage
public boolean isProjectStage(ProjectStage stage)
The default behavior of this method is to call
FacesContext.isProjectStage(jakarta.faces.application.ProjectStage)
on the wrappedFacesContext
object.- Overrides:
isProjectStage
in classFacesContext
- Parameters:
stage
- theProjectStage
to check- Returns:
- boolean indicating whether the application has the same stage.
- See Also:
FacesContext.isProjectStage(jakarta.faces.application.ProjectStage)
-
-