类 AnsiOutput
java.lang.Object
org.springframework.boot.ansi.AnsiOutput
Generates ANSI encoded output, automatically attempting to detect if the terminal
supports ANSI.
- 从以下版本开始:
- 1.0.0
- 作者:
- Phillip Webb, Yong-Hyun Kim
-
嵌套类概要
嵌套类修饰符和类型类说明static enumPossible values to pass tosetEnabled(org.springframework.boot.ansi.AnsiOutput.Enabled). -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static Stringencode(AnsiElement element) Encode a singleAnsiElementif output is enabled.static AnsiOutput.EnabledReturns if ANSI output is enabledstatic voidsetConsoleAvailable(Boolean consoleAvailable) Sets if the System.console() is known to be available.static voidsetEnabled(AnsiOutput.Enabled enabled) Sets if ANSI output is enabled.static StringCreate a new ANSI string from the specified elements.
-
构造器详细资料
-
AnsiOutput
public AnsiOutput()
-
-
方法详细资料
-
setEnabled
Sets if ANSI output is enabled.- 参数:
enabled- if ANSI is enabled, disabled or detected
-
getEnabled
Returns if ANSI output is enabled- 返回:
- if ANSI enabled, disabled or detected
-
setConsoleAvailable
Sets if the System.console() is known to be available.- 参数:
consoleAvailable- if the console is known to be available ornullto use standard detection logic.
-
encode
Encode a singleAnsiElementif output is enabled.- 参数:
element- the element to encode- 返回:
- the encoded element or an empty string
-
toString
Create a new ANSI string from the specified elements. AnyAnsiElements will be encoded as required.- 参数:
elements- the elements to encode- 返回:
- a string of the encoded elements
-