All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.checkerframework.framework.qual.LiteralKind Maven / Gradle / Ivy

Go to download

The Checker Framework enhances Java's type system to make it more powerful and useful. This lets software developers detect and prevent errors in their Java programs. The Checker Framework includes compiler plug-ins ("checkers") that find bugs or verify their absence. It also permits you to write your own compiler plug-ins.

There is a newer version: 3.44.0
Show newest version
package org.checkerframework.framework.qual;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Specifies kinds of literal trees.
 *
 * 

These correspond to the *_LITERAL constants in {@link com.sun.source.tree.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 {@link QualifierForLiterals}, instead. */ // https://docs.oracle.com/javase/8/docs/technotes/tools/findingclasses.html#bootclass public enum LiteralKind { /** Corresponds to {@link com.sun.source.tree.Tree.Kind#NULL_LITERAL} trees. */ NULL, /** Corresponds to {@link com.sun.source.tree.Tree.Kind#INT_LITERAL} trees. */ INT, /** Corresponds to {@link com.sun.source.tree.Tree.Kind#LONG_LITERAL} trees. */ LONG, /** Corresponds to {@link com.sun.source.tree.Tree.Kind#FLOAT_LITERAL} trees. */ FLOAT, /** Corresponds to {@link com.sun.source.tree.Tree.Kind#DOUBLE_LITERAL} trees. */ DOUBLE, /** Corresponds to {@link com.sun.source.tree.Tree.Kind#BOOLEAN_LITERAL} trees. */ BOOLEAN, /** Corresponds to {@link com.sun.source.tree.Tree.Kind#CHAR_LITERAL} trees. */ CHAR, /** Corresponds to {@link com.sun.source.tree.Tree.Kind#STRING_LITERAL} trees. */ STRING, /** Shorthand for all other LiteralKind constants, other than PRIMITIVE. */ ALL, /** Shorthand for all primitive LiteralKind constants: INT, LONG, FLOAT, DOUBLE, BOOLEAN, CHAR. */ PRIMITIVE; /** * Returns all LiteralKinds except for ALL and PRIMITIVE (which are shorthands for groups of other * LiteralKinds). * * @return list of LiteralKinds except for ALL and PRIMITIVE */ public static List allLiteralKinds() { List list = new ArrayList<>(Arrays.asList(values())); list.remove(ALL); list.remove(PRIMITIVE); return list; } /** * Returns the primitive {@code LiteralKind}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. * * @return list of LiteralKinds except for NULL and STRING */ public static List primitiveLiteralKinds() { return Arrays.asList(INT, LONG, FLOAT, DOUBLE, BOOLEAN, CHAR); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy