Top Description Fields Constructors Methods
jakarta.faces.event

public Class ExceptionQueuedEventContext

extends Object
implements SystemEventListenerHolder
Class Inheritance
All Implemented Interfaces
jakarta.faces.event.SystemEventListenerHolder
Imports
java.util.ArrayList, .Collections, .HashMap, .List, .Map, jakarta.faces.component.UIComponent, jakarta.faces.context.FacesContext

This helper class provides context to the ExceptionQueuedEvent regarding the state of the system at the point in time when the ExceptionQueuedEvent occurs and links the ExceptionQueuedEvent to the jakarta.faces.context.ExceptionHandler by virtue of implementing SystemEventListener.

Since
2.0

Field Summary

Modifier and TypeField and Description
private Map<Object, Object>
private final UIComponent
private final FacesContext
public static final String
IN_AFTER_PHASE_KEY

The presence of an entry under this key in the Map returned from getAttributes indicates the event occurred during the “after phase” part of the current lifecycle phase.

public static final String
IN_BEFORE_PHASE_KEY

The presence of an entry under this key in the Map returned from getAttributes indicates the event occurred during the “before phase” part of the current lifecycle phase.

private List<SystemEventListener>
private final PhaseId
private final Throwable

Constructor Summary

AccessConstructor and Description
public
ExceptionQueuedEventContext(FacesContext
FacesContext for the current request
context
,
Throwable
the Throwable that is the context for this ExceptionQueuedEventContext instance.
thrown
)

Instantiate a new ExceptionQueuedEventContext that indicates the argument Throwable just occurred.

public
ExceptionQueuedEventContext(FacesContext
FacesContext for the current request
context
,
Throwable
the Throwable that is the context for this ExceptionQueuedEventContext instance.
thrown
,
UIComponent
the UIComponent instance to which this ExceptionQueuedEventContext pertains
component
)

Instantiate a new ExceptionQueuedEventContext that indicates the argument Throwable just occurred, relevant to the argument component.

public
ExceptionQueuedEventContext(FacesContext
FacesContext for the current request
context
,
Throwable
the Throwable that is the context for this ExceptionQueuedEventContext instance.
thrown
,
UIComponent
the UIComponent that is relevant to the context.
component
,
PhaseId
the PhaseId at the time this ExeceptionEventContext is created.
phaseId
)

Instantiate a new ExceptionQueuedEventContext that indicates the argument Throwable just occurred, relevant to the argument component, during the lifecycle phase phaseId.

Method Summary

Modifier and TypeMethod and Description
public Map<Object, Object>

Returns:

attributes related to this context
getAttributes
()

A Map of attributes relevant to the context of this ExceptionQueuedEvent.

public UIComponent

Returns:

the component
getComponent
()

Return the UIComponent which was being processed when the exception was thrown.

public FacesContext

Returns:

the FacesContext used to create this ExceptionQueuedEventContext instance.
getContext
()

The FacesContext for this request.

public Throwable

Returns:

the exception
getException
()

Return the exception property.

public List<SystemEventListener>
getListenersForEventClass(Class<? extends SystemEvent>
the class for which listeners are to be returned
facesEventClass
)

Implements jakarta.faces.event.SystemEventListenerHolder.getListenersForEventClass.

Return a List that contains a single entry, the jakarta.faces.context.ExceptionHandler for the current request.

public PhaseId

Returns:

the phase id
getPhaseId
()

Return the PhaseId which was being processed when the exception was thrown.

public boolean

Returns:

true if the exception occurred during the after phase processing for a particular lifecycle phase
inAfterPhase
()

public boolean

Returns:

true if the exception occurred during the before phase processing for a particular lifecycle phase
inBeforePhase
()

private boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attributesback to summary
private Map<Object, Object> attributes
componentback to summary
private final UIComponent component
contextback to summary
private final FacesContext context
IN_AFTER_PHASE_KEYback to summary
public static final String IN_AFTER_PHASE_KEY

The presence of an entry under this key in the Map returned from getAttributes indicates the event occurred during the “after phase” part of the current lifecycle phase.

IN_BEFORE_PHASE_KEYback to summary
public static final String IN_BEFORE_PHASE_KEY

The presence of an entry under this key in the Map returned from getAttributes indicates the event occurred during the “before phase” part of the current lifecycle phase.

listenerback to summary
private List<SystemEventListener> listener
phaseIdback to summary
private final PhaseId phaseId
thrownback to summary
private final Throwable thrown

Constructor Detail

ExceptionQueuedEventContextback to summary
public ExceptionQueuedEventContext(FacesContext context, Throwable thrown)

Instantiate a new ExceptionQueuedEventContext that indicates the argument Throwable just occurred.

Parameters
context:FacesContext

FacesContext for the current request

thrown:Throwable

the Throwable that is the context for this ExceptionQueuedEventContext instance.

ExceptionQueuedEventContextback to summary
public ExceptionQueuedEventContext(FacesContext context, Throwable thrown, UIComponent component)

Instantiate a new ExceptionQueuedEventContext that indicates the argument Throwable just occurred, relevant to the argument component.

Parameters
context:FacesContext

FacesContext for the current request

thrown:Throwable

the Throwable that is the context for this ExceptionQueuedEventContext instance.

component:UIComponent

the UIComponent instance to which this ExceptionQueuedEventContext pertains

ExceptionQueuedEventContextback to summary
public ExceptionQueuedEventContext(FacesContext context, Throwable thrown, UIComponent component, PhaseId phaseId)

Instantiate a new ExceptionQueuedEventContext that indicates the argument Throwable just occurred, relevant to the argument component, during the lifecycle phase phaseId.

Parameters
context:FacesContext

FacesContext for the current request

thrown:Throwable

the Throwable that is the context for this ExceptionQueuedEventContext instance.

component:UIComponent

the UIComponent that is relevant to the context.

phaseId:PhaseId

the PhaseId at the time this ExeceptionEventContext is created.

Method Detail

getAttributesback to summary
public Map<Object, Object> getAttributes()

A Map of attributes relevant to the context of this ExceptionQueuedEvent.

Returns:Map<Object, Object>

attributes related to this context

getComponentback to summary
public UIComponent getComponent()

Return the UIComponent which was being processed when the exception was thrown. If none or not available, this will be null.

Returns:UIComponent

the component

getContextback to summary
public FacesContext getContext()

The FacesContext for this request.

Returns:FacesContext

the FacesContext used to create this ExceptionQueuedEventContext instance.

getExceptionback to summary
public Throwable getException()

Return the exception property.

Returns:Throwable

the exception

getListenersForEventClassback to summary
public List<SystemEventListener> getListenersForEventClass(Class<? extends SystemEvent> facesEventClass)

Implements jakarta.faces.event.SystemEventListenerHolder.getListenersForEventClass.

Return a List that contains a single entry, the jakarta.faces.context.ExceptionHandler for the current request.

Parameters
facesEventClass:Class<? extends SystemEvent>

Doc from jakarta.faces.event.SystemEventListenerHolder.getListenersForEventClass.

the class for which listeners are to be returned

Returns:List<SystemEventListener>

Doc from jakarta.faces.event.SystemEventListenerHolder.getListenersForEventClass.

the listeners for the argument class

Annotations
@Override
getPhaseIdback to summary
public PhaseId getPhaseId()

Return the PhaseId which was being processed when the exception was thrown. If none or not available, this will be null.

Returns:PhaseId

the phase id

inAfterPhaseback to summary
public boolean inAfterPhase()
Returns:boolean

true if the exception occurred during the after phase processing for a particular lifecycle phase

inBeforePhaseback to summary
public boolean inBeforePhase()
Returns:boolean

true if the exception occurred during the before phase processing for a particular lifecycle phase

isAttributeDefinedback to summary
private boolean isAttributeDefined(String key)