类 AnsiOutput
- java.lang.Object
- org.springframework.boot.ansi.AnsiOutput
public abstract class AnsiOutput extends Object
Generates ANSI encoded output, automatically attempting to detect if the terminal supports ANSI.
嵌套类概要
嵌套类 修饰符和类型 类 说明 static class
AnsiOutput.Enabled
Possible values to pass tosetEnabled(org.springframework.boot.ansi.AnsiOutput.Enabled)
.
构造器概要
构造器 构造器 说明 AnsiOutput()
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static String
encode(AnsiElement element)
Encode a singleAnsiElement
if output is enabled.static void
setConsoleAvailable(Boolean consoleAvailable)
Sets if the System.console() is known to be available.static void
setEnabled(AnsiOutput.Enabled enabled)
Sets if ANSI output is enabled.static String
toString(Object... elements)
Create a new ANSI string from the specified elements.
构造器详细资料
AnsiOutput
public AnsiOutput()
方法详细资料
setEnabled
public static void setEnabled(AnsiOutput.Enabled enabled)
Sets if ANSI output is enabled.- 参数:
enabled
- if ANSI is enabled, disabled or detected
setConsoleAvailable
public static void setConsoleAvailable(Boolean consoleAvailable)
Sets if the System.console() is known to be available.- 参数:
consoleAvailable
- if the console is known to be available ornull
to use standard detection logic.
encode
public static String encode(AnsiElement element)
Encode a singleAnsiElement
if output is enabled.- 参数:
element
- the element to encode- 返回:
- the encoded element or an empty string
toString
public static String toString(Object... elements)
Create a new ANSI string from the specified elements. AnyAnsiElement
s will be encoded as required.- 参数:
elements
- the elements to encode- 返回:
- a string of the encoded elements