| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.faces.component.visit.VisitContext
public abstract class VisitContext
A context object that is used to hold state relating to performing 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.
UIComponent.visitTree(), 
VisitCallback| Field Summary | |
|---|---|
| static java.util.Collection<java.lang.String> | ALL_IDSThis unmodifiable Collection is
 returned by  | 
| Constructor Summary | |
|---|---|
| VisitContext() | |
| Method Summary | |
|---|---|
| static VisitContext | createVisitContext(FacesContext context)Creates a VisitContext instance for use with UIComponent.visitTree(). | 
| static VisitContext | createVisitContext(FacesContext context,
                   java.util.Collection<java.lang.String> ids,
                   java.util.Set<VisitHint> hints)Returns a VisitContext instance that is initialized with the specified ids and hintsfor use with UIComponent#visitTree. | 
| abstract  FacesContext | getFacesContext()Returns the FacesContext for the current request. | 
| abstract  java.util.Set<VisitHint> | getHints()Returns hints that influence the behavior of the tree visit. | 
| abstract  java.util.Collection<java.lang.String> | getIdsToVisit()Returns the ids of the components to visit. | 
| abstract  java.util.Collection<java.lang.String> | getSubtreeIdsToVisit(UIComponent component) Given a  | 
| abstract  VisitResult | invokeVisitCallback(UIComponent component,
                    VisitCallback callback)Called by UIComponent.visitTree()to visit a single component. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final java.util.Collection<java.lang.String> ALL_IDS
This unmodifiable Collection is
 returned by getIdsToVisit() and
 getSubtreeIdsToVisit() in cases where all ids should
 be visited.
To simplify logic for
 visitTree() implementations, this Collection always
 returns false for isEmpty.  All other
 methods throw UnsupportedOperationException.
| Constructor Detail | 
|---|
public VisitContext()
| Method Detail | 
|---|
public abstract FacesContext getFacesContext()
Returns the FacesContext for the current request.
public abstract java.util.Collection<java.lang.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 beign performed, returns a modifiable collection containing the client ids of the components that should be visited.
public abstract java.util.Collection<java.lang.String> getSubtreeIdsToVisit(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 component
VisitContext.ALL_IDS collection.
IllegalArgumentException - if component is not
  an instance of NamingContainer
public abstract VisitResult invokeVisitCallback(UIComponent component,
                                                VisitCallback callback)
Called by UIComponent.visitTree()
 to visit a single component.
component - the component to visitcallback - the VisitCallback to call
public abstract java.util.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.
public static VisitContext createVisitContext(FacesContext context,
                                              java.util.Collection<java.lang.String> ids,
                                              java.util.Set<VisitHint> hints)
Returns a VisitContext instance that is initialized with the
 specified ids and hintsfor use with UIComponent#visitTree.
context - the FacesContext for the current requestids - the client ids of the components to visit.  If null,
   all components will be visited.hints - the VisitHints to apply to the visit.  If
 null, no hints are applied.
public static VisitContext createVisitContext(FacesContext context)
Creates a VisitContext instance for use with 
 UIComponent.visitTree().
 This method can be used to obtain a VisitContext instance
 when all components should be visited with the default
 visit hints.
context - the FacesContext for the current request
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.
Generated on 10-February-2011 12:41