Top Description Methods
org.checkerframework.framework.qual

public @Interface DefaultFor

extends Annotation
Annotations
@Documented
@Retention:RUNTIME
@Target:ANNOTATION_TYPE
Imports
java.lang.annotation.Documented, .ElementType, .Retention, .RetentionPolicy, .Target

A meta-annotation applied to the declaration of a type qualifier. It specifies that the given annotation should be the default for:

The default applies to every match for any of this annotation's conditions.

See Also
TypeUseLocation, DefaultQualifier, DefaultQualifierInHierarchy

Method Summary

Modifier and TypeMethod and Description
public String[]

Returns:

regular expressions matching variables to whose type an annotation should be applied
names
()

Returns regular expressions matching names of variables, to whose types the annotation should be applied as a default.

public String[]

Returns:

exceptions to regular expression rules
namesExceptions
()

Returns exceptions to regular expression rules.

public TypeKind[]

Returns:

TypeKinds of types for which an annotation should be implicitly added
typeKinds
()

Returns TypeKinds of types for which an annotation should be implicitly added.

public Class<?>[]

Returns:

Classes for which an annotation should be applied
types
()

Returns Classes for which an annotation should be applied.

public TypeUseLocation[]

Returns:

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

Returns the locations to which the annotation should be applied.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

namesback to summary
public String[] names()

Returns regular expressions matching names of variables, to whose types the annotation should be applied as a default. If a regular expression matches the name of a method, the annotation is applied as a default to the return type.

The regular expression must match the entire variable or method name. For example, to match any name that contains "foo", use ".*foo.*".

The default does not apply if the name matches any of the regexes in namesExceptions.

This affects formal parameter types only if one of the following is true:

  • The method's source code is available; that is, the method is type-checked along with client calls.
  • When the method was compiled in a previous run of javac, either the processor was run or the -g command-line option was provided.
Returns:String[]

regular expressions matching variables to whose type an annotation should be applied

namesExceptionsback to summary
public String[] namesExceptions()

Returns exceptions to regular expression rules.

Returns:String[]

exceptions to regular expression rules

See Also
names
typeKindsback to summary
public TypeKind[] typeKinds()

Returns TypeKinds of types for which an annotation should be implicitly added.

Returns:TypeKind[]

TypeKinds of types for which an annotation should be implicitly added

typesback to summary
public Class<?>[] types()

Returns Classes for which an annotation should be applied. For example, if @MyAnno is meta-annotated with @DefaultFor(classes=String.class), then every occurrence of String is actually @MyAnno String.

Only the given types, not their subtypes, receive the default. For instance, if the types element contains only Iterable, then the default does not apply to a variable or expression of type Collection which is a subtype of Iterable.

Returns:Class<?>[]

Classes for which an annotation should be applied

valueback to summary
public TypeUseLocation[] value()

Returns the locations to which the annotation should be applied.

Returns:TypeUseLocation[]

the locations to which the annotation should be applied