Class FacesContextWrapper
- java.lang.Object
-
- javax.faces.context.FacesContext
-
- javax.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 override
getWrapped()to return the instance being wrapping.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description FacesContextWrapper()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddMessage(java.lang.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.java.util.Map<java.lang.Object,java.lang.Object>getAttributes()The default behavior of this method is to callFacesContext.getAttributes()on the wrappedFacesContextobject.java.util.Iterator<java.lang.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.javax.el.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.FacesMessage.SeveritygetMaximumSeverity()The default behavior of this method is to callFacesContext.getMaximumSeverity()on the wrappedFacesContextobject.java.util.List<FacesMessage>getMessageList()The default behavior of this method is to callFacesContext.getMessageList()on the wrappedFacesContextobject.java.util.List<FacesMessage>getMessageList(java.lang.String clientId)The default behavior of this method is to callFacesContext.getMessageList(String)on the wrappedFacesContextobject.java.util.Iterator<FacesMessage>getMessages()The default behavior of this method is to callFacesContext.getMessages()on the wrappedFacesContextobject.java.util.Iterator<FacesMessage>getMessages(java.lang.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.java.util.List<java.lang.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.abstract 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(javax.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(java.util.List<java.lang.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 javax.faces.context.FacesContext
getCurrentInstance, setCurrentInstance
-
-
-
-
Method Detail
-
getWrapped
public abstract 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 interfaceFacesWrapper<FacesContext>- Returns:
- the wrapped
FacesContextinstance - See Also:
FacesWrapper.getWrapped()
-
getApplication
public Application getApplication()
The default behavior of this method is to call
FacesContext.getApplication()on the wrappedFacesContextobject.- Specified by:
getApplicationin classFacesContext- See Also:
FacesContext.getApplication()
-
getClientIdsWithMessages
public java.util.Iterator<java.lang.String> getClientIdsWithMessages()
The default behavior of this method is to call
FacesContext.getClientIdsWithMessages()on the wrappedFacesContextobject.- Specified by:
getClientIdsWithMessagesin classFacesContext- See Also:
FacesContext.getClientIdsWithMessages()
-
getExternalContext
public ExternalContext getExternalContext()
The default behavior of this method is to call
FacesContext.getExternalContext()on the wrappedFacesContextobject.- Specified by:
getExternalContextin classFacesContext- See Also:
FacesContext.getExternalContext()
-
getMaximumSeverity
public FacesMessage.Severity getMaximumSeverity()
The default behavior of this method is to call
FacesContext.getMaximumSeverity()on the wrappedFacesContextobject.- Specified by:
getMaximumSeverityin classFacesContext- See Also:
FacesContext.getMaximumSeverity()
-
getMessages
public java.util.Iterator<FacesMessage> getMessages()
The default behavior of this method is to call
FacesContext.getMessages()on the wrappedFacesContextobject.- Specified by:
getMessagesin classFacesContext- See Also:
FacesContext.getMessages()
-
getMessages
public java.util.Iterator<FacesMessage> getMessages(java.lang.String clientId)
The default behavior of this method is to call
FacesContext.getMessages(String)on the wrappedFacesContextobject.- Specified by:
getMessagesin classFacesContext- Parameters:
clientId- The client identifier for which messages are requested, ornullfor messages not associated with any client identifier- See Also:
FacesContext.getMessages(String)
-
getRenderKit
public RenderKit getRenderKit()
The default behavior of this method is to call
FacesContext.getRenderKit()on the wrappedFacesContextobject.- Specified by:
getRenderKitin classFacesContext- See Also:
FacesContext.getRenderKit()
-
getRenderResponse
public boolean getRenderResponse()
The default behavior of this method is to call
FacesContext.getRenderResponse()on the wrappedFacesContextobject.- Specified by:
getRenderResponsein classFacesContext- See Also:
FacesContext.getRenderResponse()
-
getResourceLibraryContracts
public java.util.List<java.lang.String> getResourceLibraryContracts()
The default behavior of this method is to call
FacesContext.getResourceLibraryContracts()on the wrappedFacesContextobject.- Overrides:
getResourceLibraryContractsin classFacesContext- See Also:
FacesContext.getResourceLibraryContracts()
-
setResourceLibraryContracts
public void setResourceLibraryContracts(java.util.List<java.lang.String> contracts)
The default behavior of this method is to call
FacesContext.setResourceLibraryContracts(java.util.List<java.lang.String>)on the wrappedFacesContextobject.- Overrides:
setResourceLibraryContractsin 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 wrappedFacesContextobject.- Specified by:
getResponseCompletein classFacesContext- See Also:
FacesContext.getResponseComplete()
-
getResponseStream
public ResponseStream getResponseStream()
The default behavior of this method is to call
FacesContext.getResponseStream()on the wrappedFacesContextobject.- Specified by:
getResponseStreamin classFacesContext- See Also:
FacesContext.getResponseStream()
-
setResponseStream
public void setResponseStream(ResponseStream responseStream)
The default behavior of this method is to call
FacesContext.setResponseStream(ResponseStream)on the wrappedFacesContextobject.- Specified by:
setResponseStreamin 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 wrappedFacesContextobject.- Specified by:
getResponseWriterin classFacesContext- See Also:
FacesContext.getResponseWriter()
-
setResponseWriter
public void setResponseWriter(ResponseWriter responseWriter)
The default behavior of this method is to call
FacesContext.setResponseWriter(ResponseWriter)on the wrappedFacesContextobject.- Specified by:
setResponseWriterin 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 wrappedFacesContextobject.- Specified by:
getViewRootin classFacesContext- See Also:
FacesContext.getViewRoot()
-
setViewRoot
public void setViewRoot(UIViewRoot root)
The default behavior of this method is to call
FacesContext.setViewRoot(UIViewRoot)on the wrappedFacesContextobject.- Specified by:
setViewRootin classFacesContext- Parameters:
root- The new componentUIViewRootcomponent- See Also:
FacesContext.setViewRoot(UIViewRoot)
-
addMessage
public void addMessage(java.lang.String clientId, FacesMessage message)The default behavior of this method is to call
FacesContext.addMessage(String, FacesMessage)on the wrappedFacesContextobject.- Specified by:
addMessagein 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 wrappedFacesContextobject.- Overrides:
isReleasedin classFacesContext- Returns:
trueif 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 wrappedFacesContextobject.- Specified by:
releasein classFacesContext- See Also:
FacesContext.release()
-
renderResponse
public void renderResponse()
The default behavior of this method is to call
FacesContext.renderResponse()on the wrappedFacesContextobject.- Specified by:
renderResponsein classFacesContext- See Also:
FacesContext.renderResponse()
-
responseComplete
public void responseComplete()
The default behavior of this method is to call
FacesContext.responseComplete()on the wrappedFacesContextobject.- Specified by:
responseCompletein classFacesContext- See Also:
FacesContext.responseComplete()
-
getAttributes
public java.util.Map<java.lang.Object,java.lang.Object> getAttributes()
The default behavior of this method is to call
FacesContext.getAttributes()on the wrappedFacesContextobject.- Overrides:
getAttributesin classFacesContext- See Also:
FacesContext.getAttributes()
-
getNamingContainerSeparatorChar
public char getNamingContainerSeparatorChar()
The default behavior of this method is to call
FacesContext.getNamingContainerSeparatorChar()on the wrappedFacesContextobject.- Overrides:
getNamingContainerSeparatorCharin classFacesContext- See Also:
FacesContext.getNamingContainerSeparatorChar()
-
getPartialViewContext
public PartialViewContext getPartialViewContext()
The default behavior of this method is to call
FacesContext.getPartialViewContext()()} on the wrappedFacesContextobject.- Overrides:
getPartialViewContextin classFacesContext- See Also:
FacesContext.getPartialViewContext()
-
getELContext
public javax.el.ELContext getELContext()
The default behavior of this method is to call
FacesContext.getELContext()on the wrappedFacesContextobject.- Overrides:
getELContextin classFacesContext- See Also:
FacesContext.getELContext()
-
getExceptionHandler
public ExceptionHandler getExceptionHandler()
The default behavior of this method is to call
FacesContext.getExceptionHandler()on the wrappedFacesContextobject.- Overrides:
getExceptionHandlerin classFacesContext- See Also:
FacesContext.getExceptionHandler()
-
setExceptionHandler
public void setExceptionHandler(ExceptionHandler exceptionHandler)
The default behavior of this method is to call
FacesContext.setExceptionHandler(ExceptionHandler)on the wrappedFacesContextobject.- Overrides:
setExceptionHandlerin classFacesContext- Parameters:
exceptionHandler- theExceptionHandlerfor this request.- See Also:
FacesContext.setExceptionHandler(ExceptionHandler)
-
getMessageList
public java.util.List<FacesMessage> getMessageList()
The default behavior of this method is to call
FacesContext.getMessageList()on the wrappedFacesContextobject.- Overrides:
getMessageListin classFacesContext- Returns:
- an immutable
Listwhich is effectively a snapshot of the messages present at the time of invocation. - See Also:
FacesContext.getMessageList()
-
getMessageList
public java.util.List<FacesMessage> getMessageList(java.lang.String clientId)
The default behavior of this method is to call
FacesContext.getMessageList(String)on the wrappedFacesContextobject.- Overrides:
getMessageListin classFacesContext- Returns:
- an immutable
Listwhich 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 wrappedFacesContextobject.- Overrides:
isPostbackin classFacesContext- See Also:
FacesContext.isPostback()
-
getCurrentPhaseId
public PhaseId getCurrentPhaseId()
The default behavior of this method is to call
FacesContext.getCurrentPhaseId()on the wrappedFacesContextobject.- Overrides:
getCurrentPhaseIdin classFacesContext- See Also:
FacesContext.getCurrentPhaseId()
-
setCurrentPhaseId
public void setCurrentPhaseId(PhaseId currentPhaseId)
The default behavior of this method is to call
FacesContext.setCurrentPhaseId(PhaseId)on the wrappedFacesContextobject.- Overrides:
setCurrentPhaseIdin classFacesContext- Parameters:
currentPhaseId- ThePhaseIdfor 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 wrappedFacesContextobject.- Overrides:
isValidationFailedin classFacesContext- See Also:
FacesContext.isValidationFailed()
-
validationFailed
public void validationFailed()
The default behavior of this method is to call
FacesContext.validationFailed()on the wrappedFacesContextobject.- Overrides:
validationFailedin 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 wrappedFacesContextobject.- Overrides:
setProcessingEventsin 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 wrappedFacesContextobject.- Overrides:
isProcessingEventsin classFacesContext- Returns:
trueif 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(javax.faces.application.ProjectStage)on the wrappedFacesContextobject.- Overrides:
isProjectStagein classFacesContext- Parameters:
stage- theProjectStageto check- See Also:
FacesContext.isProjectStage(javax.faces.application.ProjectStage)
-
-