Top Description Inners Methods
org.checkerframework.framework.qual

public @Interface DefaultQualifier

extends Annotation
Annotations
@Documented
@Retention:SOURCE
@Target:PACKAGE, TYPE, CONSTRUCTOR, METHOD, FIELD, LOCAL_VARIABLE, PARAMETER
@Repeatable:List
Imports
java.lang.annotation.Annotation, .Documented, .ElementType, .Repeatable, .Retention, .RetentionPolicy, .Target

Applied to a declaration of a package, type, method, variable, etc., specifies that the given annotation should be the default. The default is applied to type uses within the declaration for which no other annotation is explicitly written. (The default is not applied to the "parametric locations": class declarations, type parameter declarations, and type parameter uses.) If multiple DefaultQualifier annotations are in scope, the innermost one takes precedence. DefaultQualifier takes precedence over DefaultQualifierInHierarchy.

You may write multiple @DefaultQualifier annotations (for unrelated type systems, or with different locations fields) at the same location. For example:

  @DefaultQualifier(NonNull.class)
  @DefaultQualifier(value = NonNull.class, locations = TypeUseLocation.IMPLICIT_UPPER_BOUND)
  @DefaultQualifier(Tainted.class)
  class MyClass { ... }

This annotation currently has no effect in stub files.

See Also
org.checkerframework.framework.qual.TypeUseLocation, DefaultQualifierInHierarchy, DefaultFor

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static @interface
DefaultQualifier.List

A wrapper annotation that makes the DefaultQualifier annotation repeatable.

Method Summary

Modifier and TypeMethod and Description
public TypeUseLocation[]

Returns:

the locations to which the annotation should be applied
locations
()

Returns the locations to which the annotation should be applied.

public Class<? extends Annotation>
value()

The Class for the default annotation.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

locationsback to summary
public TypeUseLocation[] locations()

Returns the locations to which the annotation should be applied.

Returns:TypeUseLocation[]

the locations to which the annotation should be applied

valueback to summary
public Class<? extends Annotation> value()

The Class for the default annotation.

To prevent affecting other type systems, always specify an annotation in your own type hierarchy. (For example, do not set org.checkerframework.common.subtyping.qual.Unqualified as the default.)

org.checkerframework.framework.qual back to summary

public @Interface DefaultQualifier.List

extends Annotation
Annotations
@Documented
@Retention:RUNTIME
@Target:PACKAGE, TYPE, CONSTRUCTOR, METHOD, FIELD, LOCAL_VARIABLE, PARAMETER

A wrapper annotation that makes the DefaultQualifier annotation repeatable.

Programmers generally do not need to write this. It is created by Java when a programmer writes more than one DefaultQualifier annotation at the same location.

Method Summary

Modifier and TypeMethod and Description
public DefaultQualifier[]

Returns:

the repeatable annotations
value
()

Return the repeatable annotations.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public DefaultQualifier[] value()

Return the repeatable annotations.

Returns:DefaultQualifier[]

the repeatable annotations