spring-framework / org.springframework.lang

Package org.springframework.lang

Annotations

NonNull

class NonNull

A common Spring annotation to declare that annotated elements cannot be null. Leverages JSR 305 meta-annotations to indicate nullability in Java to common tools with JSR 305 support and used by Kotlin to infer nullability of Spring API.

Should be used at parameter, return value, and field level. Method overrides should repeat parent @NonNull annotations unless they behave differently.

Use @NonNullApi (scope = parameters + return values) and/or @NonNullFields (scope = fields) to set the default behavior to non-nullable in order to avoid annotating your whole codebase with @NonNull.

NonNullApi

class NonNullApi

A common Spring annotation to declare that parameters and return values are to be considered as non-nullable by default for a given package.

Leverages JSR-305 meta-annotations to indicate nullability in Java to common tools with JSR-305 support and used by Kotlin to infer nullability of Spring API.

Should be used at package level in association with Nullable annotations at parameter and return value level.

NonNullFields

class NonNullFields

A common Spring annotation to declare that fields are to be considered as non-nullable by default for a given package.

Leverages JSR-305 meta-annotations to indicate nullability in Java to common tools with JSR-305 support and used by Kotlin to infer nullability of Spring API.

Should be used at package level in association with Nullable annotations at field level.

UsesJava7

class UsesJava7

Indicates that the annotated element uses Java 7 specific API constructs, without implying that it strictly requires Java 7.

UsesJava8

class UsesJava8

Indicates that the annotated element uses Java 8 specific API constructs, without implying that it strictly requires Java 8.

UsesSunMisc

class UsesSunMisc

Indicates that the annotated element uses an API from the sun.misc package.