public abstract class VisitContext extends Object
A context object that is used to hold state relating to a component tree visit.
Component tree visits are initiated by calling
UIComponent.visitTree()
,
at which point both a VisitContext
and a VisitCallback
must be provided.
UIXComponent.visitTree()
,
VisitCallback
Modifier and Type | Field and Description |
---|---|
static Collection<String> |
ALL_IDS
This unmodifiable Collection is returned by
VisitContext.getIdsToVisit() and getSubtreeIdsToVisit( in cases where all ids
should be visited.
|
Constructor and Description |
---|
VisitContext() |
Modifier and Type | Method and Description |
---|---|
abstract javax.faces.context.FacesContext |
getFacesContext()
Returns the FacesContext for the current request.
|
abstract Set<VisitHint> |
getHints()
Returns hints that influence the behavior of the tree visit.
|
abstract Collection<String> |
getIdsToVisit()
Returns the ids of the components to visit.
|
abstract javax.faces.event.PhaseId |
getPhaseId()
Returns the PhaseId, if any that, that this visit is ocurring under
|
abstract Collection<String> |
getSubtreeIdsToVisit(javax.faces.component.UIComponent component)
Given a NamingContainer component, returns the client ids of
any components underneath the NamingContainer that should be
visited.
|
abstract VisitResult |
invokeVisitCallback(javax.faces.component.UIComponent component,
VisitCallback callback)
Called by
UIXComponent.visitTree()
to visit a single component. |
public static final Collection<String> ALL_IDS
This unmodifiable Collection is returned by VisitContext.getIdsToVisit() and getSubtreeIdsToVisit( in cases where all ids should be visited.
To simplify logic for visitTree() implementations, this Collection
always return false
for isEmpty
. All other methods
throw UnsupportedOperationException
.
public abstract javax.faces.context.FacesContext getFacesContext()
Returns the FacesContext for the current request.
public abstract javax.faces.event.PhaseId getPhaseId()
Returns the PhaseId, if any that, that this visit is ocurring under
public abstract Collection<String> getIdsToVisit()
Returns the ids of the components to visit.
In the case of a full tree visit, this method returns the ALL_IDS collection. Otherwise, if a partial visit is being performed, returns a modifiable collection containing the client ids of the components that should be visited.
VisitContext.ALL_IDS
, or a modifiable
Collection of client ids.public abstract Collection<String> getSubtreeIdsToVisit(javax.faces.component.UIComponent component)
Given a NamingContainer component, returns the client ids of any components underneath the NamingContainer that should be visited.
This method is called by NamingContainer visitTree() implementations to determine whether the NamingContainer contains components to be visited. In the case where no such components exist, the NamingContainer can short-circuit the tree visit and avoid descending into child subtrees.
In addition, iterating components such as UIData may be able to use the returned ids to determine which iterated states (ie. rows) need to be visited. This allows the visit traversal to be contstrained such only those rows that contain visit targets need to be traversed.
component
- a NamingContainer componentVisitContext.ALL_IDS
collection.IllegalArgumentException
- if component
is not
an instance of NamingContainerpublic abstract VisitResult invokeVisitCallback(javax.faces.component.UIComponent component, VisitCallback callback)
Called by UIXComponent.visitTree()
to visit a single component.
component
- the component to visitcallback
- the VisitCallback to callpublic abstract Set<VisitHint> getHints()
Returns hints that influence the behavior of the tree visit.
Interested parties, such as
UIComponent.visitTree()
implementations,
may check to see whether a particular hint is present by calling
VisitContext.getHints().contains()
, passing in one of the
hints defined by VisitHint
.
Copyright © 2001-2016 The Apache Software Foundation. All Rights Reserved.