public abstract class FacesContext extends Object
Constructor and Description |
---|
FacesContext() |
public abstract void addMessage(String clientId, FacesMessage message)
public abstract Application getApplication()
public static FacesContext getCurrentInstance()
public PhaseId getCurrentPhaseId()
public javax.el.ELContext getELContext()
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.
public ExceptionHandler getExceptionHandler()
public abstract ExternalContext getExternalContext()
public abstract FacesMessage.Severity getMaximumSeverity()
public List<FacesMessage> getMessageList()
public List<FacesMessage> getMessageList(String clientId)
clientId
- public abstract Iterator<FacesMessage> getMessages()
public abstract Iterator<FacesMessage> getMessages(String clientId)
public PartialViewContext getPartialViewContext()
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.
IllegalStateException
- if this method is called after this instance has been releasedpublic abstract RenderKit getRenderKit()
public abstract boolean getRenderResponse()
public abstract boolean getResponseComplete()
public abstract ResponseStream getResponseStream()
public abstract ResponseWriter getResponseWriter()
public boolean isValidationFailed()
public abstract UIViewRoot getViewRoot()
public boolean isPostback()
public boolean isProcessingEvents()
public abstract void release()
public abstract void renderResponse()
public abstract void responseComplete()
protected static void setCurrentInstance(FacesContext context)
public void setCurrentPhaseId(PhaseId currentPhaseId)
public void setExceptionHandler(ExceptionHandler exceptionHandler)
public void setProcessingEvents(boolean processingEvents)
processingEvents
- public abstract void setResponseStream(ResponseStream responseStream)
public abstract void setResponseWriter(ResponseWriter responseWriter)
public abstract void setViewRoot(UIViewRoot root)
public void validationFailed()
public boolean isProjectStage(ProjectStage stage)
public boolean isReleased()
public void setResourceLibraryContracts(List<String> contracts)
contracts
- public char getNamingContainerSeparatorChar()
Copyright © 2021 The Apache Software Foundation. All rights reserved.