public static enum CommandLine.Help.Ansi extends Enum<CommandLine.Help.Ansi>
Modifier and Type | Class and Description |
---|---|
static interface |
CommandLine.Help.Ansi.IStyle
Defines the interface for an ANSI escape sequence.
|
static class |
CommandLine.Help.Ansi.Style
A set of pre-defined ANSI escape code styles and colors, and a set of convenience methods for parsing
text with embedded markup style names, as well as convenience methods for converting
styles to strings with embedded escape codes.
|
class |
CommandLine.Help.Ansi.Text
Encapsulates rich text with styles and colors.
|
Enum Constant and Description |
---|
AUTO
Only emit ANSI escape codes if the platform supports it and system property
"picocli.ansi"
is not set to any value other than "true" (case insensitive). |
OFF
Forced OFF: never emit ANSI escape code regardless of the platform.
|
ON
Forced ON: always emit ANSI escape code regardless of the platform.
|
Modifier and Type | Method and Description |
---|---|
CommandLine.Help.Ansi.Text |
apply(String plainText,
List<CommandLine.Help.Ansi.IStyle> styles)
Returns a new Text object where all the specified styles are applied to the full length of the
specified plain text.
|
boolean |
enabled()
Returns
true if ANSI escape codes should be emitted, false otherwise. |
static CommandLine.Help.Ansi |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CommandLine.Help.Ansi[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CommandLine.Help.Ansi AUTO
"picocli.ansi"
is not set to any value other than "true"
(case insensitive).public static final CommandLine.Help.Ansi ON
public static final CommandLine.Help.Ansi OFF
public static CommandLine.Help.Ansi[] values()
for (CommandLine.Help.Ansi c : CommandLine.Help.Ansi.values()) System.out.println(c);
public static CommandLine.Help.Ansi valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean enabled()
true
if ANSI escape codes should be emitted, false
otherwise.true
, OFF: false
, AUTO: if system property "picocli.ansi"
is
defined then return its boolean value, otherwise return whether the platform supports ANSI escape codespublic CommandLine.Help.Ansi.Text apply(String plainText, List<CommandLine.Help.Ansi.IStyle> styles)
plainText
- the string to apply all styles to. Must not contain markup!styles
- the styles to apply to the full plain textCopyright © 1999-2020 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.