org.apache.myfaces.trinidad.component.visit

## Class VisitTreeUtils

- java.lang.Object
- - org.apache.myfaces.trinidad.component.visit.VisitTreeUtils

-     public final class VisitTreeUtils
      extends Object

  Utility methods to make usage of the visit tree functionality more user friendly.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Set<javax.faces.component.visit.VisitHint>` | `NON_TRANSIENT_RENDERED_HINTS` Set of `VisitHint.SKIP_UNRENDERED` and `VisitHint.SKIP_TRANSIENT` provided for convenience as it is a common use case.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static javax.faces.component.visit.VisitContext` | `createVisitContext(javax.faces.context.FacesContext context, Collection<String> ids, Set<javax.faces.component.visit.VisitHint> hints)` Deprecated. Method is no longer needed and duplicates the functionality provided by `VisitContext#createVisitContext(FacesContext, Collection, Set)`
    `static boolean` | `visitSingleComponent(javax.faces.context.FacesContext facesContext, String clientId, javax.faces.component.visit.VisitCallback visitCallback)` Visit a single component in the component tree starting from the view root.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### NON_TRANSIENT_RENDERED_HINTS

          public static final Set<javax.faces.component.visit.VisitHint> NON_TRANSIENT_RENDERED_HINTS

      Set of `VisitHint.SKIP_UNRENDERED` and `VisitHint.SKIP_TRANSIENT` provided for convenience as it is a common use case.

  - ### Method Detail

    - #### createVisitContext

          @Deprecated
          public static javax.faces.component.visit.VisitContext createVisitContext(javax.faces.context.FacesContext context,
                                                                               Collection<String> ids,
                                                                               Set<javax.faces.component.visit.VisitHint> hints)

      Deprecated. Method is no longer needed and duplicates the functionality provided by `VisitContext#createVisitContext(FacesContext, Collection, Set)`

      Creates a VisitContext instance for use with `UIComponent.visitTree(javax.faces.component.visit.VisitContext, javax.faces.component.visit.VisitCallback)`.

      Parameters:
        `context` - the FacesContext for the current request
        `ids` - the client ids of the components to visit. If null, all components will be visited.
        `hints` - the VisitHints to apply to the visit
      Returns:
        a VisitContext instance that is initialized with the specified ids and hints.

    - #### visitSingleComponent

          public static boolean visitSingleComponent(javax.faces.context.FacesContext facesContext,
                                     String clientId,
                                     javax.faces.component.visit.VisitCallback visitCallback)

      Visit a single component in the component tree starting from the view root.

      Method assumes the `RequestContext` is available and a view root must be set on the faces context.

      Parameters:
        `facesContext` - the faces context
        `clientId` - the client ID of the component to visit
        `visitCallback` - the callback to be invoked if the component is found
      Returns:
        true if a component was visited

Copyright © 2001-2017 The Apache Software Foundation. All Rights Reserved.