Class VisitContextWrapper
- All Implemented Interfaces:
FacesWrapper<VisitContext>
Provides a simple implementation of
VisitContext that can be subclassed by developers wishing to
provide specialized behavior to an existing VisitContext
instance. The default implementation of all methods is to call
through to the wrapped VisitContext instance.
Usage: extend this class and override
getWrapped() to return the instance we are wrapping.
- Since:
- 2.0
-
Field Summary
Fields inherited from class javax.faces.component.visit.VisitContext
ALL_IDS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the FacesContext for the current request.getHints()Returns hints that influence the behavior of the tree visit.Returns the ids of the components to visit.getSubtreeIdsToVisit(UIComponent component) Given aNamingContainercomponent, returns the client ids of any components underneath the NamingContainer that should be visited.abstract VisitContextA class that implements this interface uses this method to return an instance of the class being wrapped.invokeVisitCallback(UIComponent component, VisitCallback callback) Called byUIComponent.visitTree()to visit a single component.Methods inherited from class javax.faces.component.visit.VisitContext
createVisitContext, createVisitContext
-
Constructor Details
-
VisitContextWrapper
public VisitContextWrapper()
-
-
Method Details
-
getFacesContext
Description copied from class:VisitContextReturns the FacesContext for the current request.
- Specified by:
getFacesContextin classVisitContext
-
getHints
Description copied from class:VisitContextReturns 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 callingVisitContext.getHints().contains(), passing in one of the hints defined byVisitHint.- Specified by:
getHintsin classVisitContext- Returns:
- a non-empty, unmodifiable collection of VisitHints
-
getIdsToVisit
Description copied from class:VisitContextReturns 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 beign performed, returns a modifiable collection containing the client ids of the components that should be visited.
- Specified by:
getIdsToVisitin classVisitContext
-
getSubtreeIdsToVisit
Description copied from class:VisitContextGiven a
NamingContainercomponent, 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.
- Specified by:
getSubtreeIdsToVisitin classVisitContext- Parameters:
component- a NamingContainer component- Returns:
- an unmodifiable Collection containing the client ids of
any components underneath the NamingContainer that are known to be
targets of the tree visit. If no such components exist, returns
an empty Collection. If all components underneath the
NamingContainer should be visited, returns the
VisitContext.ALL_IDScollection.
-
invokeVisitCallback
Description copied from class:VisitContextCalled by
UIComponent.visitTree()to visit a single component.- Specified by:
invokeVisitCallbackin classVisitContext- Parameters:
component- the component to visitcallback- the VisitCallback to call- Returns:
- a VisitResult value that indicates whether to continue visiting the component's subtree, skip visiting the component's subtree or abort the visit altogether.
-
getWrapped
Description copied from interface:FacesWrapperA class that implements this interface uses this method to return an instance of the class being wrapped.
- Specified by:
getWrappedin interfaceFacesWrapper<VisitContext>
-