Package org.springframework.boot.ansi
Class AnsiOutput
java.lang.Object
org.springframework.boot.ansi.AnsiOutput
Generates ANSI encoded output, automatically attempting to detect if the terminal
 supports ANSI.
- Since:
- 1.0.0
- Author:
- Phillip Webb
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumPossible values to pass tosetEnabled(org.springframework.boot.ansi.AnsiOutput.Enabled).
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic 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.
- 
Constructor Details- 
AnsiOutputpublic AnsiOutput()
 
- 
- 
Method Details- 
setEnabledSets if ANSI output is enabled.- Parameters:
- enabled- if ANSI is enabled, disabled or detected
 
- 
getEnabledReturns if ANSI output is enabled- Returns:
- if ANSI enabled, disabled or detected
 
- 
setConsoleAvailableSets if the System.console() is known to be available.- Parameters:
- consoleAvailable- if the console is known to be available or- nullto use standard detection logic.
 
- 
encodeEncode a singleAnsiElementif output is enabled.- Parameters:
- element- the element to encode
- Returns:
- the encoded element or an empty string
 
- 
toStringCreate a new ANSI string from the specified elements. AnyAnsiElements will be encoded as required.- Parameters:
- elements- the elements to encode
- Returns:
- a string of the encoded elements
 
 
-