Package org.fusesource.jansi
Class AnsiRenderer
java.lang.Object
org.fusesource.jansi.AnsiRenderer
Renders ANSI color escape-codes in strings by parsing out some special syntax to pick up the correct fluff to use.
The syntax for embedded ANSI codes is:
@|code(,code)* text|@Examples:
@|bold Hello|@
@|bold,red Warning!|@
- Since:
- 2.2
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic Appendablerender(String input, Appendable target) Renders the given input to the target Appendable.static Stringprivate static Ansistatic StringrenderCodes(String codes) RendersAnsiRenderer.Codenames as an ANSI escape string.static StringrenderCodes(String... codes) RendersAnsiRenderer.Codenames as an ANSI escape string.static boolean
-
Field Details
-
BEGIN_TOKEN
- See Also:
-
END_TOKEN
- See Also:
-
CODE_TEXT_SEPARATOR
- See Also:
-
CODE_LIST_SEPARATOR
- See Also:
-
BEGIN_TOKEN_LEN
private static final int BEGIN_TOKEN_LEN- See Also:
-
END_TOKEN_LEN
private static final int END_TOKEN_LEN- See Also:
-
-
Constructor Details
-
AnsiRenderer
private AnsiRenderer()
-
-
Method Details
-
render
- Throws:
IllegalArgumentException
-
render
Renders the given input to the target Appendable.- Parameters:
input- source to rendertarget- render onto this target Appendable.- Returns:
- the given Appendable
- Throws:
IOException- If an I/O error occurs
-
render
-
renderCodes
RendersAnsiRenderer.Codenames as an ANSI escape string.- Parameters:
codes- The code names to render- Returns:
- an ANSI escape string.
-
renderCodes
RendersAnsiRenderer.Codenames as an ANSI escape string.- Parameters:
codes- A space separated list of code names to render- Returns:
- an ANSI escape string.
-
render
-
test
-