001    package edu.rice.cs.cunit.threadCheck.predicates;
002    
003    import edu.rice.cs.cunit.threadCheck.PredicateLink;
004    import edu.rice.cs.cunit.threadCheck.Combine;
005    
006    import java.lang.annotation.Retention;
007    import java.lang.annotation.RetentionPolicy;
008    import java.lang.annotation.Target;
009    import java.lang.annotation.ElementType;
010    
011    /**
012     * An annotation used to designate methods that are only allowed to be run when the
013     * method argument indexed by value is not not null.
014     * @author Mathias Ricken
015     */
016    @Retention(RetentionPolicy.RUNTIME)
017    @Target({ElementType.CONSTRUCTOR,ElementType.METHOD,ElementType.TYPE})
018    
019    @PredicateLink(value = ThreadCheckPredicates.class, method = "checkNotNullArgument", arguments = true)
020    public @interface NotNullArgument {
021        int value();
022    
023        //
024        // nested interfaces
025        //
026    
027        /**
028         * Annotation used to designate methods that are not allowed to to have any of the method arguments be null
029         * i.e. the individual @NotNullArgument annotations are combined using AND.
030         */
031        @Retention(RetentionPolicy.RUNTIME)
032        @Target({ElementType.CONSTRUCTOR,ElementType.METHOD,ElementType.TYPE})
033    
034        @Combine(value = Combine.Mode.AND, arguments = true)
035        public static @interface None {
036            NotNullArgument[] value();
037        }
038    }