framework.src.org.checkerframework.framework.qual.PolyAll Maven / Gradle / Ivy
Show all versions of checker Show documentation
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;
import org.checkerframework.framework.util.QualifierPolymorphism;
/**
* A polymorphic type qualifier that varies over all type hierarchies.
* Writing @PolyAll
is equivalent to writing a polymorphic
* qualifier for every type system.
*
*
* The @PolyAll
annotation applies to every type qualifier hierarchy for
* which no explicit qualifier is written. For example, a declaration like
* @PolyAll @NonNull String s
is polymorphic over every type system
* except the nullness type system, for which the type is fixed at
* @NonNull
.
*
*
*
*
* @PolyAll
only works for a given type system if that type system
* already has its own polymorphic qualifier, such as
* {@code @PolyNull} or {@code @PolyRegex}.
* Therefore, every type system should define a polymorphic qualifier.
* Then, to support @PolyAll
in a type system, simply add it to the
* list of supported type qualifiers.
*
* @see org.checkerframework.checker.nullness.qual.PolyNull
* @see org.checkerframework.checker.interning.qual.PolyInterned
* @see PolymorphicQualifier
* @see QualifierPolymorphism
*
* @checker_framework.manual #polyall The @PolyAll qualifier applies to every type system
*/
@Documented
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@PolymorphicQualifier
public @interface PolyAll {
// TODO: support multiple variables using an id, then uncomment some Javadoc
// int value() default 0;
}