public final class ClassTree
extends Object
GROOVY-11942: builds the inheritance/extension trees rendered by the
overview-tree.html and package-tree.html templates.
Produces two separate trees:
java.lang.Object and
built by walking each class's getParentClasses() chain,
so external ancestors (like java.lang.Throwable) appear
as non-link nodes joining the documented classes to Object.extends
relationships 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.
| Modifiers | Name | Description |
|---|---|---|
static class |
ClassTree.Node |
A node in an inheritance/extension tree. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static Node |
buildClassTree(GroovyClassDoc[] classes)Build the class tree for the given documented classes. |
|
public static Node |
buildInterfaceTree(GroovyClassDoc[] classes)Build the interface tree for the given documented classes. |
|
public static List<Node> |
sortedChildren(Node node)Helper used by templates: list of children of a node, sorted by qualified name. |
Build the class tree for the given documented classes. The returned
root is a synthetic node for java.lang.Object; traits,
interfaces, and annotation types are excluded (they belong in the
interface tree).
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.