Class PartialVisitContext


  • public class PartialVisitContext
    extends VisitContext

    A VisitContext implementation that is used when performing a partial component tree visit.

    RELEASE_PENDING
    Since:
    2.0
    • Constructor Detail

      • PartialVisitContext

        public PartialVisitContext​(FacesContext facesContext,
                                   Collection<String> clientIds)
        Creates a PartialVisitorContext instance.
        Parameters:
        facesContext - the FacesContext for the current request
        clientIds - the client ids of the components to visit
        Throws:
        NullPointerException - if facesContext is null
      • PartialVisitContext

        public PartialVisitContext​(FacesContext facesContext,
                                   Collection<String> clientIds,
                                   Set<VisitHint> hints)
        Creates a PartialVisitorContext instance with the specified hints.
        Parameters:
        facesContext - the FacesContext for the current request
        clientIds - the client ids of the components to visit
        hints - a the VisitHints for this visit
        Throws:
        NullPointerException - if facesContext is null
    • Method Detail

      • getHints

        public Set<VisitHint> getHints()
        Description copied from class: VisitContext

        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.

        Specified by:
        getHints in class VisitContext
        Returns:
        a non-empty, unmodifiable collection of VisitHints
        See Also:
        VisitContext.getHints
      • getIdsToVisit

        public Collection<String> getIdsToVisit()
        Description copied from class: VisitContext

        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.

        Specified by:
        getIdsToVisit in class VisitContext
        Returns:
        the ids of the components to visit
        See Also:
        VisitContext.getIdsToVisit()
      • getSubtreeIdsToVisit

        public Collection<String> getSubtreeIdsToVisit​(UIComponent component)
        Description copied from class: VisitContext

        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.

        Specified by:
        getSubtreeIdsToVisit in class VisitContext
        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_IDS collection.
        See Also:
        VisitContext.getSubtreeIdsToVisit()