code: public boolean visitTree(VisitContext context, VisitCallback callback)
      {
          try
          {
              pushComponentToEL(context.getFacesContext(), this);
  
              if (!isVisitable(context))
              {
                  return false;
              }
  
              VisitResult res = context.invokeVisitCallback(this, callback);
              switch (res)
              {
                  //we are done nothing has to be processed anymore
                  case COMPLETE:
                      return true;
  
                  case REJECT:
                      return false;
  
                  //accept
                  default:
                      if (getFacetCount() > 0)
                      {
                          for (UIComponent facet : getFacets().values())
                          {
                              if (facet.visitTree(context, callback))
                              {
                                  return true;
                              }
                          }
                      }
                      int childCount = getChildCount();
                      if (childCount > 0)
                      {
                          for (int i = 0; i < childCount; i++)
                          {
                              UIComponent child = getChildren().get(i);
                              if (child.visitTree(context, callback))
                              {
                                  return true;
                              }
                          }
                      }
                      return false;
              }
          }
          finally
          {
              //all components must call popComponentFromEl after visiting is finished
              popComponentFromEL(context.getFacesContext());
          }
      }
docs: The visit tree method, visit tree walks over a subtree and processes
  the callback object to perform some operation on the subtree
  <p>
  there are some details in the implementation which according to the spec have
  to be in place:
  a) before calling the callback and traversing into the subtree  pushComponentToEL
  has to be called
  b) after the processing popComponentFromEL has to be performed to remove the component
  from the el
  </p>
  <p>
  The tree traversal optimizations are located in the visit context and can be replaced
  via the VisitContextFactory in the faces-config factory section
  </p>
  
  @param context the visit context which handles the processing details
  @param callback the callback to be performed
  @return false if the processing is not done true if we can shortcut
  the visiting because we are done with everything
  
  @since 2.0