001    package edu.rice.cs.cunit.threadCheck;
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     * An annotation interface annotated with @PredicateLink may not contain other
019     * annotations or arrays of annotations as members.
020     * 
021     * The @PredicateLink and @Combine meta-annotations are mutually exclusive.
022     * @author Mathias Ricken
023     */
024    @Retention(RetentionPolicy.RUNTIME)
025    @Target({ElementType.ANNOTATION_TYPE})
026    public @interface PredicateLink {
027        /**
028         * Class containing the predicate method.
029         * @return class containing the predicate method.
030         */
031        Class value();
032    
033        /**
034         * Name of the predicate method. If not specified, the name "check" is assumed.
035         * @return name of the predicate method.
036         */
037        String method() default "check";
038    
039        /**
040         * True if method arguments should be passed to the predicate method. If not specified, false is assumed.
041         * @return true if method arguments should be passed
042         */
043        boolean arguments() default false;
044    }