Top Description Methods
org.checkerframework.framework.qual

public @Interface TargetLocations

extends Annotation
Annotations
@Documented
@Retention:RUNTIME
@Target:ANNOTATION_TYPE
Imports
java.lang.annotation.Documented, .ElementType, .Retention, .RetentionPolicy, .Target

Note

This meta-annotation is not currently enforced.

A meta-annotation that restricts the type-use locations where a type qualifier may be written. When written together with @Target({ElementType.TYPE_USE}), the given type qualifier may be written only at locations listed in the @TargetLocations(...) meta-annotation. @Target({ElementType.TYPE_USE}) together with no @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 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. For finer-grained control, override visit* methods that visit trees in BaseTypeVisitor.

This annotation does not prevent the type system from defaulting, inferring, or computing the given type annotation at the given location. It only prevents users from writing an explicit annotation at the given location.

Method Summary

Modifier and TypeMethod and Description
public TypeUseLocation[]
value()

Type uses at which the qualifier is permitted to be written in source code.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public TypeUseLocation[] value()

Type uses at which the qualifier is permitted to be written in source code.