Class NoOpFacesContext

    • Constructor Detail

      • NoOpFacesContext

        public NoOpFacesContext()
    • Method Detail

      • getMessages

        public Iterator<FacesMessage> getMessages​(String clientId)
        Description copied from class: FacesContext

        Return an Iterator over the FacesMessages that have been queued that are associated with the specified client identifier (if clientId is not null), or over the FacesMessages that have been queued that are not associated with any specific client identifier (if clientId is null). If no such messages have been queued, return an empty Iterator. The elements of the Iterator must be returned in the order in which they were added with calls to FacesContext.addMessage(java.lang.String, jakarta.faces.application.FacesMessage).

        Specified by:
        getMessages in class FacesContext
        Parameters:
        clientId - The client identifier for which messages are requested, or null for messages not associated with any client identifier
        Returns:
        Iterator over the FacesMessages.
      • getMessageList

        public List<FacesMessage> getMessageList()
        Description copied from class: FacesContext

        Like FacesContext.getMessages(), but returns a List<FacesMessage>, enabling use from Jakarta Expression Language expressions.

        The default implementation throws UnsupportedOperationException and is provided for the sole purpose of not breaking existing applications that extend this class.

        Overrides:
        getMessageList in class FacesContext
        Returns:
        an immutable List which is effectively a snapshot of the messages present at the time of invocation.
      • getMessageList

        public List<FacesMessage> getMessageList​(String clientId)
        Description copied from class: FacesContext

        Like FacesContext.getMessages(java.lang.String), but returns a List<FacesMessage> of messages for the component with client id matching argument clientId.

        The default implementation throws UnsupportedOperationException and is provided for the sole purpose of not breaking existing applications that extend this class.

        Overrides:
        getMessageList in class FacesContext
        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.
      • getRenderKit

        public RenderKit getRenderKit()
        Description copied from class: FacesContext

        Return the RenderKit instance for the render kit identifier specified on our UIViewRoot, if there is one. If there is no current UIViewRoot, if the UIViewRoot does not have a specified renderKitId, or if there is no RenderKit for the specified identifier, return null instead.

        Specified by:
        getRenderKit in class FacesContext
        Returns:
        instance of RenderKit associated with the UIViewRoot.
      • getRenderResponse

        public boolean getRenderResponse()
        Description copied from class: FacesContext

        Return true if the renderResponse() method has been called for the current request.

        Specified by:
        getRenderResponse in class FacesContext
        Returns:
        flag indicating whether the renderResponse() has been called.
      • getResponseComplete

        public boolean getResponseComplete()
        Description copied from class: FacesContext

        Return true if the responseComplete() method has been called for the current request.

        Specified by:
        getResponseComplete in class FacesContext
        Returns:
        the boolean indicating whether responseComplete() method has been called.
      • isValidationFailed

        public boolean isValidationFailed()
        Description copied from class: FacesContext

        Return true if the validationFailed() method has been called for the current request.

        Overrides:
        isValidationFailed in class FacesContext
        Returns:
        boolean indicating if the validationFailed() method has been called for the current request
      • getResponseStream

        public ResponseStream getResponseStream()
        Description copied from class: FacesContext

        Return the ResponseStream to which components should direct their binary output. Within a given response, components can use either the ResponseStream or the ResponseWriter, but not both.

        Specified by:
        getResponseStream in class FacesContext
        Returns:
        ResponseStream instance.
      • getResponseWriter

        public ResponseWriter getResponseWriter()
        Description copied from class: FacesContext

        Return the ResponseWriter to which components should direct their character-based output. Within a given response, components can use either the ResponseStream or the ResponseWriter, but not both.

        Specified by:
        getResponseWriter in class FacesContext
        Returns:
        ResponseWriter instance.
      • setViewRoot

        public void setViewRoot​(UIViewRoot root)
        Description copied from class: FacesContext

        Set the root component that is associated with this request.

        This method can be called by the application handler (or a class that the handler calls), during the Invoke Application phase of the request processing lifecycle and during the Restore View phase of the request processing lifecycle (especially when a new root component is created). In the present version of the specification, implementations are not required to enforce this restriction, though a future version of the specification may require enforcement.

        If the current UIViewRoot is non-null, and calling equals() on the argument root, passing the current UIViewRoot returns false, the clear method must be called on the Map returned from UIViewRoot.getViewMap().

        Specified by:
        setViewRoot in class FacesContext
        Parameters:
        root - The new component UIViewRoot component
      • addMessage

        public void addMessage​(String clientId,
                               FacesMessage message)
        Description copied from class: FacesContext

        Append a FacesMessage to the set of messages associated with the specified client identifier, if clientId is not null. If clientId is null, this FacesMessage is assumed to not be associated with any specific component instance.

        Specified by:
        addMessage in class FacesContext
        Parameters:
        clientId - The client identifier with which this message is associated (if any)
        message - The message to be appended
      • renderResponse

        public void renderResponse()
        Description copied from class: FacesContext

        Signal the Jakarta Faces implementation that, as soon as the current phase of the request processing lifecycle has been completed, control should be passed to the Render Response phase, bypassing any phases that have not been executed yet.

        Specified by:
        renderResponse in class FacesContext
      • responseComplete

        public void responseComplete()
        Description copied from class: FacesContext

        Signal the Jakarta Faces implementation that the HTTP response for this request has already been generated (such as an HTTP redirect), and that the request processing lifecycle should be terminated as soon as the current phase is completed.

        Specified by:
        responseComplete in class FacesContext
      • validationFailed

        public void validationFailed()
        Description copied from class: FacesContext

        Sets a flag which indicates that a conversion or validation error occurred while processing the inputs. Inputs consist of either page parameters or form bindings. This flag can be read using FacesContext.isValidationFailed().

        Overrides:
        validationFailed in class FacesContext