Enum 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 as QualifierForLiterals, instead.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ALL
      Shorthand for all other LiteralKind constants, other than PRIMITIVE.
      BOOLEAN
      Corresponds to Tree.Kind.BOOLEAN_LITERAL trees.
      CHAR
      Corresponds to Tree.Kind.CHAR_LITERAL trees.
      DOUBLE
      Corresponds to Tree.Kind.DOUBLE_LITERAL trees.
      FLOAT
      Corresponds to Tree.Kind.FLOAT_LITERAL trees.
      INT
      Corresponds to Tree.Kind.INT_LITERAL trees.
      LONG
      Corresponds to Tree.Kind.LONG_LITERAL trees.
      NULL
      Corresponds to Tree.Kind.NULL_LITERAL trees.
      PRIMITIVE
      Shorthand for all primitive LiteralKind constants: INT, LONG, FLOAT, DOUBLE, BOOLEAN, CHAR.
      STRING
      Corresponds to Tree.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 primitive LiteralKinds: 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.
      • 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

      • 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 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 name
        java.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 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