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

framework.src.org.checkerframework.framework.qual.SubtypeOf 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.*;

/**
 * A meta-annotation to specify all the qualifiers that the given qualifier
 * is a subtype of.  This provides a declarative way to specify the type
 * qualifier hierarchy.  (Alternatively, the hierarchy can be defined
 * procedurally by subclassing {@link org.checkerframework.framework.type.QualifierHierarchy} or
 * {@link org.checkerframework.framework.type.TypeHierarchy}.)
 *
 * 

* Example: *

 @SubtypeOf( { Nullable.class } )
 * public @interface NonNull { }
 * 
* *

* * If a qualified type is a subtype of the same type without any qualifier, * then use Unqualified.class in place of a type qualifier * class. For example, to express that @Encrypted C * is a subtype of C (for every class * C), and likewise for @Interned, write: * *

 @SubtypeOf(Unqualified.class)
 * public @interface Encrypted { }
 *
 * @SubtypeOf(Unqualified.class)
 * public @interface Interned { }
 * 
* *

* * For the top qualifier in the qualifier hierarchy (i.e., the * qualifier that is a supertype of all other qualifiers in the given * hierarchy), use an empty set of values: * *

 @SubtypeOf( { } )
 * public @interface Nullable { }
 *
 * @SubtypeOf( {} )
 * public @interface MaybeAliased { }
 * 
* *

* Together, all the @SubtypeOf meta-annotations fully describe the type * qualifier hierarchy. * No @SubtypeOf meta-annotation is needed on (or can be written on) the * Unqualified pseudo-qualifier, whose position in the hierarchy is * inferred from the meta-annotations on the explicit qualifiers. */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.ANNOTATION_TYPE) public @interface SubtypeOf { /** An array of the supertype qualifiers of the annotated qualifier **/ Class[] value(); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy