Enum Class TypeUseLocation
- All Implemented Interfaces:
Serializable
,Comparable<TypeUseLocation>
,Constable
DefaultQualifier
annotation applies.
The order of enums is important. Defaults are applied in this order. In particular, this means that OTHERWISE and ALL should be last.
For an annotation on a variable which has element kind ENUM_CONSTANT, the annotation's
type-use location is either TypeUseLocation.FIELD
or
TypeUseLocation.CONSTRUCTOR_RESULT
.
Note: The use locations listed here are not complete, for more details see EISOP Issue #340
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionApply default annotations to all type uses other than uses of type parameters.Apply default annotations to unannotated top-level types of constructor result types.Apply default annotations to unannotated top-level types of exception parameters.Apply default annotations to unannotated top-level explicit lower bounds of wildcards:<? super C>
.Apply default annotations to unannotated top-level explicit type parameter upper bounds:<T extends C>
.Apply default annotations to unannotated top-level explicit type parameter and wildcard upper bounds:<T extends C>
and<? extends C>
.Apply default annotations to unannotated top-level explicit wildcard upper bounds:<? extends C>
.Apply default annotations to unannotated top-level types of fields.Apply default annotations to unannotated implicit lower bounds of type parameters and wildcards:<T>
and<?>
, possibly with explicit upper bounds.Apply default annotations to unannotated upper bounds of type parameters without explicit upper bounds:<T>
.Apply default annotations to unannotated upper bounds of type parameters and wildcards without explicit upper bounds:<T>
,<?>
, and<? super C>
.Apply default annotations to unannotated upper bounds of wildcards with or without a super bound:<?>
or<? super C>
.Apply default annotations to unannotated upper bounds of wildcards without a super bound:<?>
.Apply default annotations to unannotated upper bounds of wildcards with a super bound:<? super C>
.Apply default annotations to unannotated top-level types of local variables, casts, and instanceof.Apply default annotations to unannotated top-level lower bounds of type parameters and wildcards, both explicit ones insuper
clauses, and implicit lower bounds when no explicitextends
orsuper
clause is present.Apply if nothing more concrete is provided.Apply default annotations to unannotated top-level types of formal parameter types, excluding the receiver.Apply default annotations to unannotated top-level types of receiver types.Apply default annotations to unannotated top-level types of resource variables.Apply default annotations to unannotated top-level types of return types.Apply default annotations to unannotated type variable uses that are not top-level local variables:T field
orList<T> local
.Apply default annotations to unannotated top-level upper bounds of type parameters and wildcards: both explicit ones inextends
clauses, and implicit upper bounds when no explicitextends
orsuper
clause is present. -
Method Summary
Modifier and TypeMethodDescriptionstatic TypeUseLocation
Returns the enum constant of this class with the specified name.static TypeUseLocation[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FIELD
Apply default annotations to unannotated top-level types of fields. -
LOCAL_VARIABLE
Apply default annotations to unannotated top-level types of local variables, casts, and instanceof. -
RESOURCE_VARIABLE
Apply default annotations to unannotated top-level types of resource variables. -
EXCEPTION_PARAMETER
Apply default annotations to unannotated top-level types of exception parameters. -
RECEIVER
Apply default annotations to unannotated top-level types of receiver types. -
PARAMETER
Apply default annotations to unannotated top-level types of formal parameter types, excluding the receiver. -
RETURN
Apply default annotations to unannotated top-level types of return types. -
CONSTRUCTOR_RESULT
Apply default annotations to unannotated top-level types of constructor result types. -
LOWER_BOUND
Apply default annotations to unannotated top-level lower bounds of type parameters and wildcards, both explicit ones insuper
clauses, and implicit lower bounds when no explicitextends
orsuper
clause is present. -
EXPLICIT_LOWER_BOUND
Apply default annotations to unannotated top-level explicit lower bounds of wildcards:<? super C>
. Type parameters have no syntax for explicit lower bound types. -
IMPLICIT_LOWER_BOUND
Apply default annotations to unannotated implicit lower bounds of type parameters and wildcards:<T>
and<?>
, possibly with explicit upper bounds. -
UPPER_BOUND
Apply default annotations to unannotated top-level upper bounds of type parameters and wildcards: both explicit ones inextends
clauses, and implicit upper bounds when no explicitextends
orsuper
clause is present.Especially useful for parametrized classes that provide a lot of static methods with the same generic parameters as the class.
-
EXPLICIT_UPPER_BOUND
Apply default annotations to unannotated top-level explicit type parameter and wildcard upper bounds:<T extends C>
and<? extends C>
. -
EXPLICIT_TYPE_PARAMETER_UPPER_BOUND
Apply default annotations to unannotated top-level explicit type parameter upper bounds:<T extends C>
. -
EXPLICIT_WILDCARD_UPPER_BOUND
Apply default annotations to unannotated top-level explicit wildcard upper bounds:<? extends C>
. -
IMPLICIT_UPPER_BOUND
Apply default annotations to unannotated upper bounds of type parameters and wildcards without explicit upper bounds:<T>
,<?>
, and<? super C>
. -
IMPLICIT_TYPE_PARAMETER_UPPER_BOUND
Apply default annotations to unannotated upper bounds of type parameters without explicit upper bounds:<T>
. -
IMPLICIT_WILDCARD_UPPER_BOUND_NO_SUPER
Apply default annotations to unannotated upper bounds of wildcards without a super bound:<?>
. -
IMPLICIT_WILDCARD_UPPER_BOUND_SUPER
Apply default annotations to unannotated upper bounds of wildcards with a super bound:<? super C>
. -
IMPLICIT_WILDCARD_UPPER_BOUND
Apply default annotations to unannotated upper bounds of wildcards with or without a super bound:<?>
or<? super C>
. -
TYPE_VARIABLE_USE
Apply default annotations to unannotated type variable uses that are not top-level local variables:T field
orList<T> local
.Such uses of type variables are not flow-sensitively refined and are therefore usually parametric.
To get parametric polymorphism: add a qualifier that is meta-annotated with
ParametricTypeVariableUseQualifier
to your type system and use it as default forTYPE_VARIABLE_USE
, which is treated like no annotation on the type variable use.We could name this constant
TYPE_VARIABLE_USE_NOT_TOP_LEVEL_LOCAL_VARIABLE
and introduce a separate constantTYPE_VARIABLE_USE_TOP_LEVEL_LOCAL_VARIABLE
. At the moment we use theLOCAL_VARIABLE
default for unannotated top-level type variable uses of local variables:T local
. -
OTHERWISE
Apply if nothing more concrete is provided. TODO: clarify relation to ALL. -
ALL
Apply default annotations to all type uses other than uses of type parameters. Does not allow any of the other constants. Usually you want OTHERWISE.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-