Package Torello.JavaDoc.Messager
Class PrintMessage
- java.lang.Object
-
- Torello.JavaDoc.Messager.PrintMessage
-
public class PrintMessage extends java.lang.Object
This is an internally used class whose primary purpose is to generate the actual Java-Strings which are printed to the User's Terminal on Error.PrintMessage
is the core printer class used by the Messager system to emit structured messages to the user’s terminal. Its job is to control the final appearance of the output — including indentation, spacing, line-wrapping, and ANSI color codes — when reporting errors or assertion failures.
This class is responsible for producing the complete, flushed message block that the user ultimately sees on the screen. It writes directly to the terminal via thescreenWriterSW
field (defined insidePrintRecord
), which acts as the standard output buffer.
APrintMessage
is not a passive data holder. It is an active builder that provides methods to:- Set a heading (e.g.,
WARNING
,ASSERT
) - Adjust indentation for nested or hierarchical message blocks
- Add one or more lines of text content
- Control blank lines before or after the block
- Apply terminal styles or ANSI color codes
These methods allow the developer to assemble a well-formatted message interactively, line-by-line, before it is ultimately flushed to the output stream using.print()
or a related flush method.
The structure of a full error message might include:- A top-level heading (generated using
PrintHeading
) - A few explanatory lines, indented consistently
- Optional spacing or blank lines between sections
- Line-length wrapping, if enabled
- Final output sent to both the terminal and (optionally) the logging appendable
UnlikePrintRecord
, this class is not a singleton and is not reused. Each instance represents a new block of output, fully constructed and flushed before disposal.
From the perspective of developers using the Messager API,PrintMessage
is the primary class to interact with. It allows you to express the structure, formatting, and context of a message without worrying about the low-level details of terminal output or log writing.
This class does not manage state across invocations — it simply builds and emits a single message block using the values already available insidePrintRecord
.
Click the “Hi-Lited Source” button above to view the full implementation and method list.
Written by Chat-GPT, on July 1st, 2025
Hi-Lited Source-Code:- View Here: Torello/JavaDoc/Messager/PrintMessage.java
- Open New Browser-Tab: Torello/JavaDoc/Messager/PrintMessage.java
File Size: 12,566 Bytes Line Count: 300 '\n' Characters Found
- Set a heading (e.g.,