org.apache.myfaces.trinidad.component.visit

## Class VisitContextWrapper

- java.lang.Object
- - org.apache.myfaces.trinidad.component.visit.VisitContext
  - - org.apache.myfaces.trinidad.component.visit.VisitContextWrapper

-     public abstract class VisitContextWrapper
      extends VisitContext

  A port of the JSF 2 `VisitContextWrapper` class so that we may be able to use its functionality in JSF 1.2 with Trinidad 1.2

- - ### Field Summary

    - ### Fields inherited from class org.apache.myfaces.trinidad.component.visit.VisitContext

      `ALL_IDS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `VisitContextWrapper()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.faces.context.FacesContext` | `getFacesContext()` Returns the FacesContext for the current request.
    `Set<VisitHint>` | `getHints()` Returns hints that influence the behavior of the tree visit.
    `Collection<String>` | `getIdsToVisit()` Returns the ids of the components to visit.
    `javax.faces.event.PhaseId` | `getPhaseId()` Returns the PhaseId, if any that, that this visit is ocurring under
    `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 VisitContext` | `getWrapped()` Get the wrapped visit context
    `VisitResult` | `invokeVisitCallback(javax.faces.component.UIComponent component, VisitCallback callback)` Called by `UIXComponent.visitTree()` to visit a single component.

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

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

- - ### Constructor Detail

    - #### VisitContextWrapper

          public VisitContextWrapper()

  - ### Method Detail

    - #### getWrapped

          public abstract VisitContext getWrapped()

      Get the wrapped visit context

    - #### getFacesContext

          public javax.faces.context.FacesContext getFacesContext()

      Description copied from class: `VisitContext`

      Returns the FacesContext for the current request.

      Specified by:
        `getFacesContext` in class `VisitContext`

    - #### getPhaseId

          public javax.faces.event.PhaseId getPhaseId()

      Description copied from class: `VisitContext`

      Returns the PhaseId, if any that, that this visit is ocurring under

      Specified by:
        `getPhaseId` in class `VisitContext`
      Returns:
        the current PhaseId

    - #### 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

    - #### 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 being performed, returns a modifiable collection containing the client ids of the components that should be visited.

      Specified by:
        `getIdsToVisit` in class `VisitContext`
      Returns:
        `VisitContext.ALL_IDS`, or a modifiable Collection of client ids.

    - #### getSubtreeIdsToVisit

          public Collection<String> getSubtreeIdsToVisit(javax.faces.component.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.

    - #### invokeVisitCallback

          public VisitResult invokeVisitCallback(javax.faces.component.UIComponent component,
                                        VisitCallback callback)

      Description copied from class: `VisitContext`

      Called by `UIXComponent.visitTree()` to visit a single component.

      Specified by:
        `invokeVisitCallback` in class `VisitContext`
      Parameters:
        `component` - the component to visit
        `callback` - 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.

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