org.springframework.shell.support.util
Enum AnsiEscapeCode

java.lang.Object
  extended by java.lang.Enum<AnsiEscapeCode>
      extended by org.springframework.shell.support.util.AnsiEscapeCode
All Implemented Interfaces:
Serializable, Comparable<AnsiEscapeCode>

public enum AnsiEscapeCode
extends Enum<AnsiEscapeCode>

ANSI escape codes supported by JLine

Since:
1.2.0

Enum Constant Summary
BLINK
           
BOLD
           
CONCEALED
           
FG_BLACK
           
FG_BLUE
           
FG_CYAN
           
FG_GREEN
           
FG_MAGENTA
           
FG_RED
           
FG_WHITE
           
FG_YELLOW
           
OFF
           
REVERSE
           
UNDERSCORE
           
 
Method Summary
static String decorate(String text, AnsiEscapeCode... codes)
          Decorates the given text with the given escape codes (turning them off afterwards)
static AnsiEscapeCode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static AnsiEscapeCode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BLINK

public static final AnsiEscapeCode BLINK

BOLD

public static final AnsiEscapeCode BOLD

CONCEALED

public static final AnsiEscapeCode CONCEALED

FG_BLACK

public static final AnsiEscapeCode FG_BLACK

FG_BLUE

public static final AnsiEscapeCode FG_BLUE

FG_CYAN

public static final AnsiEscapeCode FG_CYAN

FG_GREEN

public static final AnsiEscapeCode FG_GREEN

FG_MAGENTA

public static final AnsiEscapeCode FG_MAGENTA

FG_RED

public static final AnsiEscapeCode FG_RED

FG_YELLOW

public static final AnsiEscapeCode FG_YELLOW

FG_WHITE

public static final AnsiEscapeCode FG_WHITE

OFF

public static final AnsiEscapeCode OFF

REVERSE

public static final AnsiEscapeCode REVERSE

UNDERSCORE

public static final AnsiEscapeCode UNDERSCORE
Method Detail

values

public static AnsiEscapeCode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (AnsiEscapeCode c : AnsiEscapeCode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static AnsiEscapeCode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

decorate

public static String decorate(String text,
                              AnsiEscapeCode... codes)
Decorates the given text with the given escape codes (turning them off afterwards)

Parameters:
text - the text to decorate; can be null
codes -
Returns:
null if null is passed