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

framework.src.org.checkerframework.framework.qual.ImplicitFor 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.42.0
Show newest version
package org.checkerframework.framework.qual;

/*>>>
import org.checkerframework.checker.nullness.qual.Nullable;
*/

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.lang.model.type.TypeKind;

/**
 * A meta-annotation that specifies the trees and types for which the framework
 * should automatically add that qualifier. These types and trees can be
 * specified via any combination of six attributes.
 *
 * 

* For example, the {@code Nullable} annotation is annotated * with *

 *   @ImplicitFor(trees={Tree.Kind.NULL_LITERAL})
 * 
* to denote that * the framework should automatically apply {@code Nullable} to all instances * of "null." * */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.ANNOTATION_TYPE) public @interface ImplicitFor { /** * @return {@link LiteralKind}s for which an annotation should be * implicitly added */ LiteralKind[] literals() default {}; /** * @return {@link TypeKind}s of types for which an annotation should be * implicitly added */ TypeKind[] types() default {}; /** * @return {@link Class}es (in the actual program) for which an annotation * should be implicitly added. * For example, "java.lang.Void.class" should receive the same annotation * as the null literal. */ Class[] typeNames() default {}; /** * @return regular expressions of string literals, the types of which * an annotation should be implicitly added. * If multiple patterns match, then the string literal is given the * greatest lower bound of all the matches. */ String[] stringPatterns() default {}; // TODO: do we need an option to provide implicits for locations // specified by a TypeUseLocation (which should then be renamed)? }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy