Enum LiteralKind
- java.lang.Object
-
- java.lang.Enum<LiteralKind>
-
- org.checkerframework.framework.qual.LiteralKind
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<LiteralKind>
public enum LiteralKind extends java.lang.Enum<LiteralKind>
Specifies kinds of literal trees.These correspond to the *_LITERAL constants in
Tree.Kind
. However, that enum is in the tools.jar which is not on the user's classpath by default. This enum is used by meta-annotations, such asQualifierForLiterals
, instead.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALL
Shorthand for all other LiteralKind constants, other than PRIMITIVE.BOOLEAN
Corresponds toTree.Kind.BOOLEAN_LITERAL
trees.CHAR
Corresponds toTree.Kind.CHAR_LITERAL
trees.DOUBLE
Corresponds toTree.Kind.DOUBLE_LITERAL
trees.FLOAT
Corresponds toTree.Kind.FLOAT_LITERAL
trees.INT
Corresponds toTree.Kind.INT_LITERAL
trees.LONG
Corresponds toTree.Kind.LONG_LITERAL
trees.NULL
Corresponds toTree.Kind.NULL_LITERAL
trees.PRIMITIVE
Shorthand for all primitive LiteralKind constants: INT, LONG, FLOAT, DOUBLE, BOOLEAN, CHAR.STRING
Corresponds toTree.Kind.STRING_LITERAL
trees.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<LiteralKind>
allLiteralKinds()
Returns all LiteralKinds except for ALL and PRIMITIVE (which are shorthands for groups of other LiteralKinds).static java.util.List<LiteralKind>
primitiveLiteralKinds()
Returns the primitiveLiteralKind
s: INT, LONG, FLOAT, DOUBLE, BOOLEAN, CHAR.static LiteralKind
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static LiteralKind[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NULL
public static final LiteralKind NULL
Corresponds toTree.Kind.NULL_LITERAL
trees.
-
INT
public static final LiteralKind INT
Corresponds toTree.Kind.INT_LITERAL
trees.
-
LONG
public static final LiteralKind LONG
Corresponds toTree.Kind.LONG_LITERAL
trees.
-
FLOAT
public static final LiteralKind FLOAT
Corresponds toTree.Kind.FLOAT_LITERAL
trees.
-
DOUBLE
public static final LiteralKind DOUBLE
Corresponds toTree.Kind.DOUBLE_LITERAL
trees.
-
BOOLEAN
public static final LiteralKind BOOLEAN
Corresponds toTree.Kind.BOOLEAN_LITERAL
trees.
-
CHAR
public static final LiteralKind CHAR
Corresponds toTree.Kind.CHAR_LITERAL
trees.
-
STRING
public static final LiteralKind STRING
Corresponds toTree.Kind.STRING_LITERAL
trees.
-
ALL
public static final LiteralKind ALL
Shorthand for all other LiteralKind constants, other than PRIMITIVE.
-
PRIMITIVE
public static final LiteralKind PRIMITIVE
Shorthand for all primitive LiteralKind constants: INT, LONG, FLOAT, DOUBLE, BOOLEAN, CHAR.
-
-
Method Detail
-
values
public static LiteralKind[] 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 (LiteralKind c : LiteralKind.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static LiteralKind valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
allLiteralKinds
public static java.util.List<LiteralKind> allLiteralKinds()
Returns all LiteralKinds except for ALL and PRIMITIVE (which are shorthands for groups of other LiteralKinds).- Returns:
- list of LiteralKinds except for ALL and PRIMITIVE
-
primitiveLiteralKinds
public static java.util.List<LiteralKind> primitiveLiteralKinds()
Returns the primitiveLiteralKind
s: INT, LONG, FLOAT, DOUBLE, BOOLEAN, CHAR. This is all LiteralKinds except for NULL, STRING, and ones that are shorthands for groups of other LiteralKinds.- Returns:
- list of LiteralKinds except for NULL and STRING
-
-