- Direct Known Subclasses:
InitFacesContext
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addMessage
(String clientId, FacesMessage message) Append aFacesMessage
to the set of messages associated with the specified client identifier, ifclientId
is notnull
.Return anIterator
over the client identifiers for which at least oneFacesMessage
has been queued.Return the maximum severity level recorded on anyFacesMessage
s that has been queued, whether or not they are associated with any specificUIComponent
.LikeFacesContext.getMessages()
, but returns aList<FacesMessage>
, enabling use from Jakarta Expression Language expressions.getMessageList
(String clientId) LikeFacesContext.getMessages(java.lang.String)
, but returns aList<FacesMessage>
of messages for the component with client id matching argumentclientId
.Return anIterator
over theFacesMessage
s that have been queued, whether or not they are associated with any specific client identifier.getMessages
(String clientId) Return anIterator
over theFacesMessage
s that have been queued that are associated with the specified client identifier (ifclientId
is notnull
), or over theFacesMessage
s that have been queued that are not associated with any specific client identifier (ifclientId
isnull
).Return theRenderKit
instance for the render kit identifier specified on ourUIViewRoot
, if there is one.boolean
Returntrue
if therenderResponse()
method has been called for the current request.boolean
Returntrue
if theresponseComplete()
method has been called for the current request.Return theResponseStream
to which components should direct their binary output.Return theResponseWriter
to which components should direct their character-based output.boolean
Returntrue
if thevalidationFailed()
method has been called for the current request.void
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.void
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.void
setResponseStream
(ResponseStream responseStream) Set theResponseStream
to which components should direct their binary output.void
setResponseWriter
(ResponseWriter responseWriter) Set theResponseWriter
to which components should direct their character-based output.void
setViewRoot
(UIViewRoot root) Set the root component that is associated with this request.void
Sets a flag which indicates that a conversion or validation error occurred while processing the inputs.Methods inherited from class jakarta.faces.context.FacesContext
getApplication, getAttributes, getCurrentInstance, getCurrentPhaseId, getELContext, getExceptionHandler, getExternalContext, getNamingContainerSeparatorChar, getPartialViewContext, getResourceLibraryContracts, getViewRoot, isPostback, isProcessingEvents, isProjectStage, isReleased, release, setCurrentInstance, setCurrentPhaseId, setExceptionHandler, setProcessingEvents, setResourceLibraryContracts
-
Constructor Details
-
NoOpFacesContext
public NoOpFacesContext()
-
-
Method Details
-
getLifecycle
Description copied from class:FacesContext
Return the
Lifecycle
instance for thisFacesContext
instance.- Specified by:
getLifecycle
in classFacesContext
- Returns:
- instance of
Lifecycle
-
getClientIdsWithMessages
Description copied from class:FacesContext
Return an
Iterator
over the client identifiers for which at least oneFacesMessage
has been queued. If there are no such client identifiers, an emptyIterator
is returned. If any messages have been queued that were not associated with any specific client identifier, anull
value will be included in the iterated values. The elements in theIterator
must be returned in the order in which they were added withFacesContext.addMessage(java.lang.String, jakarta.faces.application.FacesMessage)
.- Specified by:
getClientIdsWithMessages
in classFacesContext
- Returns:
- the
Iterator
over the client identifiers for which at least oneFacesMessage
has been queued.
-
getMaximumSeverity
Description copied from class:FacesContext
Return the maximum severity level recorded on any
FacesMessage
s that has been queued, whether or not they are associated with any specificUIComponent
. If no such messages have been queued, returnnull
.- Specified by:
getMaximumSeverity
in classFacesContext
- Returns:
- the maximum severity level.
-
getMessages
Description copied from class:FacesContext
Return an
Iterator
over theFacesMessage
s that have been queued, whether or not they are associated with any specific client identifier. If no such messages have been queued, return an emptyIterator
. The elements of theIterator
must be returned in the order in which they were added with calls toFacesContext.addMessage(java.lang.String, jakarta.faces.application.FacesMessage)
.- Specified by:
getMessages
in classFacesContext
- Returns:
Iterator
over theFacesMessage
s that have been queued.
-
getMessages
Description copied from class:FacesContext
Return an
Iterator
over theFacesMessage
s that have been queued that are associated with the specified client identifier (ifclientId
is notnull
), or over theFacesMessage
s that have been queued that are not associated with any specific client identifier (ifclientId
isnull
). If no such messages have been queued, return an emptyIterator
. The elements of theIterator
must be returned in the order in which they were added with calls toFacesContext.addMessage(java.lang.String, jakarta.faces.application.FacesMessage)
.- 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.
-
getMessageList
Description copied from class:FacesContext
Like
FacesContext.getMessages()
, but returns aList<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 classFacesContext
- Returns:
- an immutable
List
which is effectively a snapshot of the messages present at the time of invocation.
-
getMessageList
Description copied from class:FacesContext
Like
FacesContext.getMessages(java.lang.String)
, but returns aList<FacesMessage>
of messages for the component with client id matching argumentclientId
.The default implementation throws
UnsupportedOperationException
and is provided for the sole purpose of not breaking existing applications that extend this class.- 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.
-
getRenderKit
Description copied from class:FacesContext
Return the
RenderKit
instance for the render kit identifier specified on ourUIViewRoot
, if there is one. If there is no currentUIViewRoot
, if theUIViewRoot
does not have a specifiedrenderKitId
, or if there is noRenderKit
for the specified identifier, returnnull
instead.- Specified by:
getRenderKit
in classFacesContext
- Returns:
- instance of
RenderKit
associated with theUIViewRoot
.
-
getRenderResponse
public boolean getRenderResponse()Description copied from class:FacesContext
Return
true
if therenderResponse()
method has been called for the current request.- Specified by:
getRenderResponse
in classFacesContext
- Returns:
- flag indicating whether the
renderResponse()
has been called.
-
getResponseComplete
public boolean getResponseComplete()Description copied from class:FacesContext
Return
true
if theresponseComplete()
method has been called for the current request.- Specified by:
getResponseComplete
in classFacesContext
- Returns:
- the boolean indicating whether
responseComplete()
method has been called.
-
isValidationFailed
public boolean isValidationFailed()Description copied from class:FacesContext
Return
true
if thevalidationFailed()
method has been called for the current request.- Overrides:
isValidationFailed
in classFacesContext
- Returns:
- boolean indicating if the
validationFailed()
method has been called for the current request
-
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 classFacesContext
- Returns:
ResponseStream
instance.
-
setResponseStream
Description copied from class:FacesContext
Set the
ResponseStream
to which components should direct their binary output.- Specified by:
setResponseStream
in classFacesContext
- Parameters:
responseStream
- The new ResponseStream for this response
-
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 classFacesContext
- Returns:
ResponseWriter
instance.
-
setResponseWriter
Description copied from class:FacesContext
Set the
ResponseWriter
to which components should direct their character-based output.- Specified by:
setResponseWriter
in classFacesContext
- Parameters:
responseWriter
- The new ResponseWriter for this response
-
setViewRoot
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 callingequals()
on the argumentroot
, passing the currentUIViewRoot
returnsfalse
, theclear
method must be called on theMap
returned fromUIViewRoot.getViewMap()
.- Specified by:
setViewRoot
in classFacesContext
- Parameters:
root
- The new componentUIViewRoot
component
-
addMessage
Description copied from class:FacesContext
Append a
FacesMessage
to the set of messages associated with the specified client identifier, ifclientId
is notnull
. IfclientId
isnull
, thisFacesMessage
is assumed to not be associated with any specific component instance.- Specified by:
addMessage
in classFacesContext
- 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 classFacesContext
-
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 classFacesContext
-
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 classFacesContext
-