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

checkers.quals.Dependent Maven / Gradle / Ivy

Go to download

Annotations ("type qualifiers") from the checker framework, backported so they can be used in pre-JDK8 applications

There is a newer version: 1.7.5
Show newest version
package checkers.quals;

import java.lang.annotation.*;

/**
 * Refines the qualified type of the annotated field or variable based on the
 * qualified type of the receiver.  The annotation declares a relationship
 * between multiple type qualifier hierarchies.
 *
 * 

Example: * Consider a field, {@code lock}, that is only initialized if the * enclosing object (the receiver), is marked as {@code ThreadSafe}. * Such a field can be declared as: * *


 *   private @Nullable @Dependent(result=NonNull.class, when=ThreadSafe.class)
 *     Lock lock;
 * 
*/ @Documented @Retention(RetentionPolicy.RUNTIME) public @interface Dependent { /** * The class of the refined qualifier to be applied. */ Class result(); /** * The qualifier class of the receiver that causes the {@code result} * qualifier to be applied. */ Class when(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy