Class ClassTree
java.lang.Object
org.codehaus.groovy.tools.groovydoc.ClassTree
GROOVY-11942: builds the inheritance/extension trees rendered by the
overview-tree.html and package-tree.html templates.
Produces two separate trees:
- The class tree is rooted at
java.lang.Objectand built by walking each class'sgetParentClasses()chain, so external ancestors (likejava.lang.Throwable) appear as non-link nodes joining the documented classes to Object. - The interface tree lists top-level interfaces and traits
whose parent interfaces are not themselves documented in this
tree, with children determined by direct
extendsrelationships between documented interfaces. Interfaces with multiple parents may appear under more than one root.
Traits are treated as interfaces for the purposes of grouping,
matching their JVM representation, but retain their isTrait()
flag so templates can render them with a distinct label.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA node in an inheritance/extension tree. -
Method Summary
Modifier and TypeMethodDescriptionstatic ClassTree.NodebuildClassTree(GroovyClassDoc[] classes) Build the class tree for the given documented classes.static ClassTree.NodebuildInterfaceTree(GroovyClassDoc[] classes) Build the interface tree for the given documented classes.static List<ClassTree.Node>sortedChildren(ClassTree.Node node) Helper used by templates: list of children of a node, sorted by qualified name.
-
Method Details
-
buildClassTree
Build the class tree for the given documented classes. The returned root is a synthetic node forjava.lang.Object; traits, interfaces, and annotation types are excluded (they belong in the interface tree). -
buildInterfaceTree
Build the interface tree for the given documented classes. Returns a synthetic top-level node whose children are the top-level interfaces/traits — i.e. those whose super-interfaces aren't themselves present in the input set. -
sortedChildren
Helper used by templates: list of children of a node, sorted by qualified name. Returns an empty list whennodeisnull.
-