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>
- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description FacesContextWrapper()Deprecated.FacesContextWrapper(FacesContext delegate)
-
Method Summary
-
Methods inherited from class javax.faces.context.FacesContext
getCurrentInstance, setCurrentInstance
-
-
-
-
Constructor Detail
-
FacesContextWrapper
@Deprecated public FacesContextWrapper()
Deprecated.
-
FacesContextWrapper
public FacesContextWrapper(FacesContext delegate)
-
-
Method Detail
-
addMessage
public void addMessage(String clientId, FacesMessage message)
- Specified by:
addMessagein classFacesContext
-
getApplication
public Application getApplication()
- Specified by:
getApplicationin classFacesContext
-
getAttributes
public Map<Object,Object> getAttributes()
- Overrides:
getAttributesin classFacesContext- Returns:
-
getClientIdsWithMessages
public Iterator<String> getClientIdsWithMessages()
- Specified by:
getClientIdsWithMessagesin classFacesContext
-
getCurrentPhaseId
public PhaseId getCurrentPhaseId()
- Overrides:
getCurrentPhaseIdin classFacesContext- Returns:
-
getELContext
public javax.el.ELContext getELContext()
Description copied from class:FacesContextReturn the context within which all EL-expressions are evaluated.A JSF implementation is expected to provide a full implementation of this class. However JSF 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 JSF1.2. Decorator classes that were written for JSF1.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 JSF 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 JSF 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 JSF implementation (Mojarra) does something similar.
- Overrides:
getELContextin classFacesContext
-
getExceptionHandler
public ExceptionHandler getExceptionHandler()
- Overrides:
getExceptionHandlerin classFacesContext- Returns:
-
getExternalContext
public ExternalContext getExternalContext()
- Specified by:
getExternalContextin classFacesContext
-
getMaximumSeverity
public FacesMessage.Severity getMaximumSeverity()
- Specified by:
getMaximumSeverityin classFacesContext
-
getMessageList
public List<FacesMessage> getMessageList()
- Overrides:
getMessageListin classFacesContext- Returns:
-
getMessageList
public List<FacesMessage> getMessageList(String clientId)
- Overrides:
getMessageListin classFacesContext- Returns:
-
getMessages
public Iterator<FacesMessage> getMessages()
- Specified by:
getMessagesin classFacesContext
-
getMessages
public Iterator<FacesMessage> getMessages(String clientId)
- Specified by:
getMessagesin classFacesContext
-
getPartialViewContext
public PartialViewContext getPartialViewContext()
Description copied from class:FacesContextReturn 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:
getPartialViewContextin classFacesContext- Returns:
- The PartialViewContext
-
getRenderKit
public RenderKit getRenderKit()
- Specified by:
getRenderKitin classFacesContext
-
getRenderResponse
public boolean getRenderResponse()
- Specified by:
getRenderResponsein classFacesContext
-
getResponseComplete
public boolean getResponseComplete()
- Specified by:
getResponseCompletein classFacesContext
-
getResponseStream
public ResponseStream getResponseStream()
- Specified by:
getResponseStreamin classFacesContext
-
getResponseWriter
public ResponseWriter getResponseWriter()
- Specified by:
getResponseWriterin classFacesContext
-
isValidationFailed
public boolean isValidationFailed()
- Overrides:
isValidationFailedin classFacesContext- Returns:
-
getViewRoot
public UIViewRoot getViewRoot()
- Specified by:
getViewRootin classFacesContext
-
getWrapped
public 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 instance of the class being wrapped
-
isPostback
public boolean isPostback()
- Overrides:
isPostbackin classFacesContext- Returns:
-
isProcessingEvents
public boolean isProcessingEvents()
- Overrides:
isProcessingEventsin classFacesContext- Returns:
-
release
public void release()
- Specified by:
releasein classFacesContext
-
renderResponse
public void renderResponse()
- Specified by:
renderResponsein classFacesContext
-
responseComplete
public void responseComplete()
- Specified by:
responseCompletein classFacesContext
-
setCurrentPhaseId
public void setCurrentPhaseId(PhaseId currentPhaseId)
- Overrides:
setCurrentPhaseIdin classFacesContext
-
setExceptionHandler
public void setExceptionHandler(ExceptionHandler exceptionHandler)
- Overrides:
setExceptionHandlerin classFacesContext
-
setProcessingEvents
public void setProcessingEvents(boolean processingEvents)
- Overrides:
setProcessingEventsin classFacesContext
-
setResponseStream
public void setResponseStream(ResponseStream responseStream)
- Specified by:
setResponseStreamin classFacesContext
-
setResponseWriter
public void setResponseWriter(ResponseWriter responseWriter)
- Specified by:
setResponseWriterin classFacesContext
-
setViewRoot
public void setViewRoot(UIViewRoot root)
- Specified by:
setViewRootin classFacesContext
-
validationFailed
public void validationFailed()
- Overrides:
validationFailedin classFacesContext
-
isProjectStage
public boolean isProjectStage(ProjectStage stage)
- Overrides:
isProjectStagein classFacesContext
-
isReleased
public boolean isReleased()
- Overrides:
isReleasedin classFacesContext- Returns:
-
getNamingContainerSeparatorChar
public char getNamingContainerSeparatorChar()
- Overrides:
getNamingContainerSeparatorCharin classFacesContext- Returns:
-
setResourceLibraryContracts
public void setResourceLibraryContracts(List<String> contracts)
- Overrides:
setResourceLibraryContractsin classFacesContext
-
getResourceLibraryContracts
public List<String> getResourceLibraryContracts()
- Overrides:
getResourceLibraryContractsin classFacesContext- Returns:
-
-