]> iEval git - fonbot.git/blame - src/org/eclipse/jdt/annotation/NonNullByDefault.java
Fix reboot
[fonbot.git] / src / org / eclipse / jdt / annotation / NonNullByDefault.java
CommitLineData
8dfb76c9
MG
1/*******************************************************************************
2 * Copyright (c) 2011 Stephan Herrmann and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Stephan Herrmann - initial API and implementation
10 * IBM Corporation - bug fixes
11 *******************************************************************************/
12package org.eclipse.jdt.annotation;
13
14import static java.lang.annotation.ElementType.CONSTRUCTOR;
15import static java.lang.annotation.ElementType.METHOD;
16import static java.lang.annotation.ElementType.PACKAGE;
17import static java.lang.annotation.ElementType.TYPE;
18
19import java.lang.annotation.Documented;
20import java.lang.annotation.Retention;
21import java.lang.annotation.RetentionPolicy;
22import java.lang.annotation.Target;
23
24/**
25 * This annotation can be applied to a package, type, method or constructor in order to
26 * define that all contained entities for which a null annotation is otherwise lacking
27 * should be considered as {@link NonNull @NonNull}.
28 * <dl>
29 * <dt>Canceling a default</dt>
30 * <dd>By using a <code>@NonNullByDefault</code> annotation with the argument <code>false</code>,
31 * a default from any enclosing scope can be canceled for the element being annotated.
32 * <dt>Nested defaults</dt>
33 * <dd>If a <code>@NonNullByDefault</code>
34 * annotation is used within the scope of another <code>@NonNullByDefault</code>
35 * annotation or a project-wide default setting, the innermost annotation defines the
36 * default applicable at any given position (depending on the parameter {@link #value()}).</dd>
37 * </dl>
38 * Note that for applying an annotation to a package, a file by the name
39 * <code>package-info.java</code> is used.
40 *
41 * @since 1.0
42 */
43@Documented
44@Retention(RetentionPolicy.CLASS)
45@Target({ PACKAGE, TYPE, METHOD, CONSTRUCTOR })
46public @interface NonNullByDefault {
47 /**
48 * When parameterized with <code>false</code>, the annotation specifies that the current element should not apply
49 * any default to un-annotated types.
50 */
51 boolean value() default true;
52}
This page took 0.023174 seconds and 4 git commands to generate.