Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.util
Class BaseTreeVisitor

    java.lang.Object
      org.apache.cayenne.util.BaseTreeVisitor

All Implemented Interfaces:
  HierarchicalTreeVisitor

    public class BaseTreeVisitor

extends Object
implements HierarchicalTreeVisitor

A common superclass for specialized tree visitors. Can also be used as a noop pass-through visitor for nodes that need no processing by themselves.

Author:
  Andrus Adamchik

Field Summary
`protected Map` | `childVisitors`
`protected boolean` | `terminatingOnNoChildVisitor`

Constructor Summary
`BaseTreeVisitor()`

Method Summary
`void` | `addChildVisitor(Class childClass, HierarchicalTreeVisitor visitor)`
`HierarchicalTreeVisitor` | `childVisitor(ProjectPath path, Class childType)` Returns an instance of the child visitor for a given project path and a type of child.
`boolean` | `isTerminatingOnNoChildVisitor()`
`void` | `onFinishNode(ProjectPath path)` Invoked at the end of the annotation tree traversal, which is done in a depth-first manner.
`boolean` | `onStartNode(ProjectPath path)` Invoked in the beginning of the element subtree traversal.
`void` | `setTerminatingOnNoChildVisitor(boolean terminatingOnNoChildVisitor)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### childVisitors

    protected Map childVisitors

### terminatingOnNoChildVisitor

    protected boolean terminatingOnNoChildVisitor

Constructor Detail

### BaseTreeVisitor

    public BaseTreeVisitor()

Method Detail

### isTerminatingOnNoChildVisitor

    public boolean isTerminatingOnNoChildVisitor()

### setTerminatingOnNoChildVisitor

    public void setTerminatingOnNoChildVisitor(boolean terminatingOnNoChildVisitor)

### childVisitor

    public HierarchicalTreeVisitor childVisitor(ProjectPath path,
                                                Class childType)

  Description copied from interface: `HierarchicalTreeVisitor`
  Returns an instance of the child visitor for a given project path and a type of child. Returning null would result in skipping the particular child type.

  Specified by:
    `childVisitor` in interface `HierarchicalTreeVisitor`

### onFinishNode

    public void onFinishNode(ProjectPath path)

  Description copied from interface: `HierarchicalTreeVisitor`
  Invoked at the end of the annotation tree traversal, which is done in a depth-first manner.

  Specified by:
    `onFinishNode` in interface `HierarchicalTreeVisitor`

### onStartNode

    public boolean onStartNode(ProjectPath path)

  Description copied from interface: `HierarchicalTreeVisitor`
  Invoked in the beginning of the element subtree traversal. Traversal is done in a depth-first manner, so returning false from this method would suppress child elements traversal.

  Specified by:
    `onStartNode` in interface `HierarchicalTreeVisitor`

### addChildVisitor

    public void addChildVisitor(Class childClass,
                                HierarchicalTreeVisitor visitor)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2007 Apache Cayenne. All Rights Reserved.