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

framework.src.org.checkerframework.framework.qual.DefaultQualifier 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 java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PACKAGE;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE;

/**
 * Applied to a declaration of a package, type, method, variable, etc.,
 * specifies that the given annotation should be the default.  The default is
 * applied to type uses within the declaration for which no other
 * annotation is explicitly written.
 * (The default is not applied to the "parametric locations":  class
 * declarations, type parameter declarations, and type parameter uses.)
 * If multiple DefaultQualifier annotations are in scope, the innermost one
 * takes precedence.
 * DefaultQualifier takes precedence over {@link DefaultQualifierInHierarchy}.
 * 

* * If you wish to write multiple @DefaultQualifier annotations (for * unrelated type systems, or with different {@code locations} fields) at * the same location, use {@link DefaultQualifiers}. * * @see TypeUseLocation * @see DefaultQualifiers * @see DefaultQualifierInHierarchy * @see DefaultFor */ @Documented @Retention(RetentionPolicy.SOURCE) @Target({PACKAGE, TYPE, CONSTRUCTOR, METHOD, FIELD, LOCAL_VARIABLE, PARAMETER}) public @interface DefaultQualifier { /** * The Class for the default annotation. * *

* * To prevent affecting other type systems, always specify an annotation * in your own type hierarchy. (For example, do not set * "org.checkerframework.framework.qual.Unqualified" as the default.) */ Class value(); /** @return the locations to which the annotation should be applied */ TypeUseLocation[] locations() default { TypeUseLocation.ALL }; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy