001    package edu.rice.cs.cunit.threadCheck.subAnnot;
002    
003    import java.lang.annotation.RetentionPolicy;
004    import java.lang.annotation.Target;
005    import java.lang.annotation.ElementType;
006    import java.lang.annotation.Retention;
007    
008    /**
009     * Meta-annotation that provides a link to a class and method that serve as predicate.
010     * That method has to be accessible from a static context, return boolean, accept Object
011     * as first parameter, and have parameters with the types and names of each of the
012     * members contained in the annotation annotated by @PredicateLink, except for members
013     * that are annotations or arrays of annotations.
014     *
015     * The @PredicateLink meta-annotation lets the Thread Checker know that the annotation
016     * interface annotated with it is intended to be processed by the Thread Checker.
017     *
018     * This is for annotations supporting subtyping.
019     * @author Mathias Ricken
020     */
021    @Retention(RetentionPolicy.RUNTIME)
022    @Target({ElementType.ANNOTATION_TYPE})
023    public @interface PredicateLink {
024        /**
025         * Class containing the predicate method.
026         * @return class containing the predicate method.
027         */
028        public abstract Class value();
029    
030        /**
031         * Name of the predicate method. If not specified, the name "check" is assumed.
032         * @return name of the predicate method.
033         */
034        public abstract String method() default "check";
035    
036        /**
037         * True if method arguments should be passed to the predicate method. If not specified, false is assumed.
038         * @return true if method arguments should be passed
039         */
040        public abstract boolean arguments() default false;
041    }