Enum LiteralKind

java.lang.Object
java.lang.Enum<LiteralKind>
org.checkerframework.framework.qual.LiteralKind
All Implemented Interfaces:
Serializable, Comparable<LiteralKind>, java.lang.constant.Constable

public enum LiteralKind extends 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 as QualifierForLiterals, instead.

  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Shorthand for all other LiteralKind constants, other than PRIMITIVE.
    Corresponds to Tree.Kind.BOOLEAN_LITERAL trees.
    Corresponds to Tree.Kind.CHAR_LITERAL trees.
    Corresponds to Tree.Kind.DOUBLE_LITERAL trees.
    Corresponds to Tree.Kind.FLOAT_LITERAL trees.
    Corresponds to Tree.Kind.INT_LITERAL trees.
    Corresponds to Tree.Kind.LONG_LITERAL trees.
    Corresponds to Tree.Kind.NULL_LITERAL trees.
    Shorthand for all primitive LiteralKind constants: INT, LONG, FLOAT, DOUBLE, BOOLEAN, CHAR.
    Corresponds to Tree.Kind.STRING_LITERAL trees.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns all LiteralKinds except for ALL and PRIMITIVE (which are shorthands for groups of other LiteralKinds).
    Returns the primitive LiteralKinds: INT, LONG, FLOAT, DOUBLE, BOOLEAN, CHAR.
    Returns the enum constant of this type with the specified name.
    static LiteralKind[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • NULL

      public static final LiteralKind NULL
      Corresponds to Tree.Kind.NULL_LITERAL trees.
    • INT

      public static final LiteralKind INT
      Corresponds to Tree.Kind.INT_LITERAL trees.
    • LONG

      public static final LiteralKind LONG
      Corresponds to Tree.Kind.LONG_LITERAL trees.
    • FLOAT

      public static final LiteralKind FLOAT
      Corresponds to Tree.Kind.FLOAT_LITERAL trees.
    • DOUBLE

      public static final LiteralKind DOUBLE
      Corresponds to Tree.Kind.DOUBLE_LITERAL trees.
    • BOOLEAN

      public static final LiteralKind BOOLEAN
      Corresponds to Tree.Kind.BOOLEAN_LITERAL trees.
    • CHAR

      public static final LiteralKind CHAR
      Corresponds to Tree.Kind.CHAR_LITERAL trees.
    • STRING

      public static final LiteralKind STRING
      Corresponds to Tree.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 Details

    • values

      public static LiteralKind[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static LiteralKind 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
    • allLiteralKinds

      public static 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 List<LiteralKind> primitiveLiteralKinds()
      Returns the primitive LiteralKinds: 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