TextReportRenderer

A ReportVisitor that renders a ReportNode tree to plain text.

This is the simplest renderer and serves as the end-to-end validation of the visitor traversal pattern. It delegates all statistical table formatting to StatisticReporter, preserving the existing KSL console output experience.

Node rendering:

All mutable state uses the my prefix per KSL coding conventions.

Parameters

ctx

the render context supplying output paths and formatting preferences

Constructors

Link copied to clipboard
constructor(ctx: RenderContext = RenderContext())

Functions

Link copied to clipboard
open override fun enterDocument(node: ReportNode.Document)
Link copied to clipboard
open override fun enterSection(node: ReportNode.Section)
Link copied to clipboard
open override fun exitDocument(node: ReportNode.Document)
Link copied to clipboard
open override fun exitSection(node: ReportNode.Section)
Link copied to clipboard
fun output(): String

Returns the accumulated report as a plain-text String.

Link copied to clipboard
fun result(): String

Returns the accumulated plain-text report as a String.

Link copied to clipboard
open override fun visit(node: ReportNode.DataTable)
open override fun visit(node: ReportNode.Heading)
open override fun visit(node: ReportNode.PageBreak)
open override fun visit(node: ReportNode.Paragraph)
open override fun visit(node: ReportNode.PlotNode)
open override fun visit(node: ReportNode.RawText)
open override fun visit(node: ReportNode.StatPropertyTable)
open override fun visit(node: ReportNode.StatTable)
open override fun visit(node: ReportNode.WeightedStatTable)
Link copied to clipboard

Writes the accumulated report to the given PrintWriter.

fun writeTo(path: Path): File

Writes the accumulated report to a file at path and returns a File reference.