Package org.jline.jansi
Class AnsiRenderer
java.lang.Object
org.jline.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 -
Method Summary
Modifier and TypeMethodDescriptionstatic String
static Appendable
render
(String input, Appendable target) Renders the given input to the target Appendable.static String
static String
renderCodes
(String codes) RendersAnsiRenderer.Code
names as an ANSI escape string.static String
renderCodes
(String... codes) RendersAnsiRenderer.Code
names 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:
-
-
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.Code
names as an ANSI escape string.- Parameters:
codes
- The code names to render- Returns:
- an ANSI escape string.
-
renderCodes
RendersAnsiRenderer.Code
names as an ANSI escape string.- Parameters:
codes
- A space separated list of code names to render- Returns:
- an ANSI escape string.
-
test
-