Package: org.codehaus.groovy.tools.groovydoc

## [Java] Class ClassTree

- org.codehaus.groovy.tools.groovydoc.ClassTree

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

  - The class tree is rooted at `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.
  - The interface tree lists top-level interfaces and traits whose parent interfaces are not themselves documented in this tree, with children determined by direct `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.

  Since:
    6.0.0

- - ### Nested Class Summary

    Nested classes
    Modifiers | Name | Description
    --- | --- | ---
    `static class` | `ClassTree.Node` | A node in an inheritance/extension tree.

  - ### Methods Summary

    Methods
    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.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### public static Node buildClassTree(GroovyClassDoc[] classes)

      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).

    - #### public static Node buildInterfaceTree(GroovyClassDoc[] classes)

      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.

    - #### public static List<Node> sortedChildren(Node node)

      Helper used by templates: list of children of a node, sorted by qualified name. Returns an empty list when `node` is `null`.