Can't apply @Nonnull on marker annotation anymore
[null-analysis.git] / src / main / java / com / github / sebhoss / nullanalysis / NotNullByDefault.java
blob6a8039d56e0b2460edbc3783401cdbfccd72016e
1 /*
2 * Copyright © 2013 Sebastian Hoß <mail@shoss.de>
3 * This work is free. You can redistribute it and/or modify it under the
4 * terms of the Do What The Fuck You Want To Public License, Version 2,
5 * as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
6 */
7 package com.github.sebhoss.nullanalysis;
9 import java.lang.annotation.Documented;
10 import java.lang.annotation.ElementType;
11 import java.lang.annotation.Inherited;
12 import java.lang.annotation.Retention;
13 import java.lang.annotation.RetentionPolicy;
15 import javax.annotation.meta.TypeQualifierDefault;
17 /**
18 * This annotation can be applied to a package, class or method to indicate that the class fields, method return types
19 * and parameters in that element are not null by default unless there is:
20 * <ul>
21 * <li>An explicit nullness annotation
22 * <li>The method overrides a method in a superclass (in which case the annotation of the corresponding parameter in the
23 * superclass applies)
24 * <li>there is a default parameter annotation applied to a more tightly nested element.
25 * </ul>
26 * <p/>
28 @Documented
29 @Inherited
30 @TypeQualifierDefault({ ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.FIELD,
31 ElementType.LOCAL_VARIABLE, ElementType.METHOD, ElementType.PACKAGE, ElementType.PARAMETER, ElementType.TYPE })
32 @Retention(RetentionPolicy.RUNTIME)
33 public @interface NotNullByDefault {
35 // marker annotation