Class ProjectNode

java.lang.Object
uno.anahata.asi.nb.tools.project.components.ProjectNode
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
JavaPackage, JavaSourceGroup, ProjectComponent, ProjectStructure, ResourceFolder, ResourceSourceGroup

public abstract class ProjectNode extends Object implements Serializable
The abstract base class for all structural nodes in the project model. It defines the foundational contract for recursive metadata aggregation and Markdown-based visualization.
Author:
Anahata
See Also:
  • Constructor Details

    • ProjectNode

      public ProjectNode()
  • Method Details

    • getTotalSize

      public abstract long getTotalSize()
      Calculates the total recursive size of this node and all its descendants.

      Implementation details: This method must perform a deep traversal of the subtree rooted at this node, summing the sizes of all constituent physical files or logical components to provide an accurate total byte count for the branch.

      Returns:
      The total size in bytes.
    • renderMarkdown

      public abstract void renderMarkdown(StringBuilder sb, String indent, boolean summary)
      Renders the node and its children into a Markdown representation.

      Implementation details: The renderer must strictly honor the 'summary' flag. In summary mode, it should only output aggregate totals for the node. In standard mode, it must perform a hierarchical traversal, using indentation to represent nesting depth and specialized icons to denote node types.

      Parameters:
      sb - The target StringBuilder to append the Markdown to.
      indent - The current indentation string (e.g., " ") for nesting level.
      summary - If true, renders only the condensed/aggregate view.