Class TypeVarUseApplier
java.lang.Object
org.checkerframework.framework.util.element.TypeVarUseApplier
Apply annotations to the use of a type parameter declaration.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
accepts
(AnnotatedTypeMirror type, Element element) Returns true if type is an AnnotatedTypeVariable, or an AnnotatedArrayType with a type variable component, and the element is not a TYPE_PARAMETER.static void
apply
(AnnotatedTypeMirror type, Element element, AnnotatedTypeFactory atypeFactory) Apply annotations fromelement
totype
.void
Applies the bound annotations from the declaration of the type parameter and then applies the explicit annotations written on the type variable.
-
Method Details
-
apply
public static void apply(AnnotatedTypeMirror type, Element element, AnnotatedTypeFactory atypeFactory) throws ElementAnnotationUtil.UnexpectedAnnotationLocationException Apply annotations fromelement
totype
.- Parameters:
type
- the type to annotateelement
- the corresponding elementatypeFactory
- the type factory- Throws:
ElementAnnotationUtil.UnexpectedAnnotationLocationException
- if there is trouble
-
accepts
Returns true if type is an AnnotatedTypeVariable, or an AnnotatedArrayType with a type variable component, and the element is not a TYPE_PARAMETER.- Parameters:
type
- the type to testelement
- the corresponding element- Returns:
- true if type is an AnnotatedTypeVariable, or an AnnotatedArrayType with a type variable component, and the element is not a TYPE_PARAMETER
-
extractAndApply
Applies the bound annotations from the declaration of the type parameter and then applies the explicit annotations written on the type variable.- Throws:
ElementAnnotationUtil.UnexpectedAnnotationLocationException
- if invalid location for an annotation was found
-