Class AnsiPrintStream
- All Implemented Interfaces:
AnsiHelper
A more convenient print stream API to use for printing things out to the console, supporting ANSI styling if the underlying terminal supports it and fluid use (e.g. it returns itself)
-
Constructor Summary
ConstructorDescriptionAnsiPrintStream
(Terminal terminal) Create a print stream wrapping the given terminal's stdoutAnsiPrintStream
(CommandLine.Help.Ansi ansi, PrintStream out) -
Method Summary
Modifier and TypeMethodDescriptiongetAnsi()
Print the given object's toString representation raw (no ansi escaping) to the underlying stream.println()
Print a new line to the underlying streamPrint the given object's toString representation raw (no ansi escaping) to the underlying stream.printlnMarkup
(String markupText) Print the given text to the underlying stream, parsing picocli markup and converting it to have the correct escape codes.printlnStyles
(String plainText, CommandLine.Help.Ansi.Style... styles) Print the given text to the underlying stream, wrapping it in the given styles (if supported).printMarkup
(String markupText) Print the given text to the underlying stream, parsing picocli markup and converting it to have the correct escape codesprintStyles
(String plainText, CommandLine.Help.Ansi.IStyle... styles) Print the given text to the underlying stream, wrapping it in the given styles (if supported)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface nz.org.riskscape.cli.AnsiHelper
applyMarkup, applyStyles, applyStyles
-
Constructor Details
-
AnsiPrintStream
Create a print stream wrapping the given terminal's stdout
-
AnsiPrintStream
-
-
Method Details
-
print
Print the given object's toString representation raw (no ansi escaping) to the underlying stream.
-
println
Print the given object's toString representation raw (no ansi escaping) to the underlying stream. A new line is appended.
-
printStyles
Print the given text to the underlying stream, wrapping it in the given styles (if supported)
-
printlnStyles
Print the given text to the underlying stream, wrapping it in the given styles (if supported). A new line is appended.
-
printMarkup
Print the given text to the underlying stream, parsing picocli markup and converting it to have the correct escape codes
-
printlnMarkup
Print the given text to the underlying stream, parsing picocli markup and converting it to have the correct escape codes. A new line is appended.
-
println
Print a new line to the underlying stream
-
getAnsi
- Specified by:
getAnsi
in interfaceAnsiHelper
- Returns:
- the ansi object we are wrapping
-