类 AnsiOutput
java.lang.Object
cn.taketoday.core.ansi.AnsiOutput
Generates ANSI encoded output, automatically attempting to detect if the terminal
supports ANSI.
- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb
-
嵌套类概要
嵌套类修饰符和类型类说明static enumPossible values to pass tosetEnabled(cn.taketoday.core.ansi.AnsiOutput.Enabled). -
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明private static voidbuildDisabled(StringBuilder sb, Object[] elements) private static voidbuildEnabled(StringBuilder sb, Object[] elements) private static booleanstatic Stringencode(AnsiElement element) Encode a singleAnsiElementif output is enabled.static AnsiOutput.EnabledReturns if ANSI output is enabledprivate static booleanstatic 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
-
buildEnabled
-
buildDisabled
-
isEnabled
private static boolean isEnabled() -
detectIfAnsiCapable
private static boolean detectIfAnsiCapable()
-