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

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

/**
 * A meta-annotation that restricts the type-use locations where a type
 * qualifier may be written.  When written together with
 * {@code @Target({ElementType.TYPE_USE})}, the given type qualifier may be
 * written only at locations listed in the {@code @TargetLocations(...)}
 * meta-annotation.  {@code @Target({ElementType.TYPE_USE})} together with no
 * {@code @TargetLocations(...)} means that the qualifier can be written on any
 * type use.
 * 

* * This enables a type system designer to permit a qualifier to be written * only in certain locations. For example, some type systems' top and bottom * qualifier (such as * {@link org.checkerframework.checker.nullness.qual.KeyForBottom}) * should only be written on an explicit wildcard upper or lower bound. * This meta-annotation is a declarative, coarse-grained approach to enable * that. A {@link org.checkerframework.common.basetype.TypeValidator} must be * implemented if a more fine-grained control is necessary. * */ // TODO: Verify this meta-annotation (step 3 in https://github.com/typetools/checker-framework/issues/515). @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.ANNOTATION_TYPE) public @interface TargetLocations { /** * Type uses at which the qualifier is permitted to be written * in source code. */ TypeUseLocation[] value(); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy