public class MessageUtils extends Object
Internally, Jansi is used to render ANSI colors on any platform.
Constructor and Description |
---|
MessageUtils() |
Modifier and Type | Method and Description |
---|---|
static MessageBuilder |
buffer()
Create a default message buffer.
|
static MessageBuilder |
buffer(int size)
Create a message buffer with an internal buffer of defined size.
|
static MessageBuilder |
buffer(StringBuilder builder)
Create a message buffer with defined String builder.
|
static boolean |
isColorEnabled()
Is message color enabled: requires JAnsi available (through Maven) and the color has not been disabled.
|
static void |
setColorEnabled(boolean flag)
Enables message color (if JAnsi is available).
|
static String |
stripAnsiCodes(String msg)
Remove any ANSI code from a message (colors or other escape sequences).
|
static void |
systemInstall()
Install color support.
|
static void |
systemUninstall()
Undo a previous
systemInstall() . |
public static void systemInstall()
public static void systemUninstall()
systemInstall()
. If systemInstall()
was called
multiple times, systemUninstall()
must be called call the same number of times before
it is actually uninstalled.public static void setColorEnabled(boolean flag)
flag
- public static boolean isColorEnabled()
public static MessageBuilder buffer()
public static MessageBuilder buffer(StringBuilder builder)
public static MessageBuilder buffer(int size)
Copyright © 2004–2018 The Apache Software Foundation. All rights reserved.