Package software.amazon.smithy.cli
Interface ColorFormatter
-
- All Known Implementing Classes:
AnsiColorFormatter
public interface ColorFormatterStyles text using color codes.- See Also:
for the ANSI implementation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidendStyle(java.lang.Appendable appendable)booleanisColorEnabled()default voidprintln(java.lang.Appendable appendable, java.lang.String text, Style... styles)Print a styled line of text to the givenappendable.voidstartStyle(java.lang.Appendable appendable, Style... style)default voidstyle(java.lang.Appendable appendable, java.lang.String text, Style... styles)Styles text using the given styles and writes it to an Appendable.default java.lang.Stringstyle(java.lang.String text, Style... styles)Styles text using the given styles.
-
-
-
Method Detail
-
style
default java.lang.String style(java.lang.String text, Style... styles)Styles text using the given styles.- Parameters:
text- Text to style.styles- Styles to apply.- Returns:
- Returns the styled text.
-
style
default void style(java.lang.Appendable appendable, java.lang.String text, Style... styles)Styles text using the given styles and writes it to an Appendable.- Parameters:
appendable- Where to write styled text.text- Text to write.styles- Styles to apply.
-
println
default void println(java.lang.Appendable appendable, java.lang.String text, Style... styles)Print a styled line of text to the givenappendable.- Parameters:
appendable- Where to write.text- Text to write.styles- Styles to apply.
-
isColorEnabled
boolean isColorEnabled()
- Returns:
- Returns true if this formatter supports color output.
-
startStyle
void startStyle(java.lang.Appendable appendable, Style... style)
-
endStyle
void endStyle(java.lang.Appendable appendable)
-
-