Class CFAbstractValue.AnnotationSetCombiner
java.lang.Object
org.checkerframework.framework.flow.CFAbstractValue.AnnotationSetCombiner
- Direct Known Subclasses:
CFAbstractValue.ValueGlb
,CFAbstractValue.ValueLub
- Enclosing class:
- CFAbstractValue<V extends CFAbstractValue<V>>
Combines two sets of AnnotationMirrors by hierarchy.
Subclasses must define how to combine sets by implementing the following methods:
#combineTwoAnnotations(AnnotationMirror, AnnotationMirror, AnnotationMirror)
#combineOneAnnotation(AnnotationMirror, AnnotatedTypeVariable, AnnotationMirror, boolean)
#combineNoAnnotations(AnnotatedTypeVariable, AnnotatedTypeVariable, AnnotationMirror, boolean)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract @Nullable AnnotationMirror
combineNoAnnotations
(AnnotatedTypeMirror.AnnotatedTypeVariable aAtv, AnnotatedTypeMirror.AnnotatedTypeVariable bAtv, AnnotationMirror top, boolean canCombinedSetBeMissingAnnos) Returns the primary annotation that result from of combining the twoAnnotatedTypeMirror.AnnotatedTypeVariable
.protected abstract @Nullable AnnotationMirror
combineOneAnnotation
(AnnotationMirror annotation, AnnotatedTypeMirror.AnnotatedTypeVariable typeVar, AnnotationMirror top, boolean canCombinedSetBeMissingAnnos) Returns the result of combiningannotation
withtypeVar
.protected AnnotationMirrorSet
combineSets
(TypeMirror aTypeMirror, AnnotationMirrorSet aSet, TypeMirror bTypeMirror, AnnotationMirrorSet bSet, boolean canCombinedSetBeMissingAnnos) Combines the two sets.protected abstract @Nullable AnnotationMirror
Returns the result of combining the two annotations.
-
Constructor Details
-
AnnotationSetCombiner
protected AnnotationSetCombiner()
-
-
Method Details
-
combineSets
protected AnnotationMirrorSet combineSets(TypeMirror aTypeMirror, AnnotationMirrorSet aSet, TypeMirror bTypeMirror, AnnotationMirrorSet bSet, boolean canCombinedSetBeMissingAnnos) Combines the two sets.- Parameters:
aTypeMirror
- the type mirror associated withaSet
aSet
- a set of annotation mirrorsbTypeMirror
- the type mirror associated withbSet
bSet
- a set of annotation mirrorscanCombinedSetBeMissingAnnos
- whether or not the combined set can be missing annotations- Returns:
- the combined sets
-
combineTwoAnnotations
protected abstract @Nullable AnnotationMirror combineTwoAnnotations(AnnotationMirror a, AnnotationMirror b, AnnotationMirror top) Returns the result of combining the two annotations. This method is called when an annotation exists in both sets for the hierarchy whose top istop
.- Parameters:
a
- an annotation in the hierarchyb
- an annotation in the hierarchytop
- the top annotation in the hierarchy- Returns:
- the result of combining the two annotations or null if no combination exists
-
combineNoAnnotations
protected abstract @Nullable AnnotationMirror combineNoAnnotations(AnnotatedTypeMirror.AnnotatedTypeVariable aAtv, AnnotatedTypeMirror.AnnotatedTypeVariable bAtv, AnnotationMirror top, boolean canCombinedSetBeMissingAnnos) Returns the primary annotation that result from of combining the twoAnnotatedTypeMirror.AnnotatedTypeVariable
. If the result has not primary annotation, thenull
is returned. This method is called when no annotation exists in either sets for the hierarchy whose top istop
.- Parameters:
aAtv
- a type variable that does not have a primary annotation intop
hierarchybAtv
- a type variable that does not have a primary annotation intop
hierarchytop
- the top annotation in the hierarchycanCombinedSetBeMissingAnnos
- whether or not- Returns:
- the result of combining the two type variables, which may be null
-
combineOneAnnotation
protected abstract @Nullable AnnotationMirror combineOneAnnotation(AnnotationMirror annotation, AnnotatedTypeMirror.AnnotatedTypeVariable typeVar, AnnotationMirror top, boolean canCombinedSetBeMissingAnnos) Returns the result of combiningannotation
withtypeVar
.This is called when an annotation exists for the hierarchy in on set, but not the other.
- Parameters:
annotation
- an annotationtypeVar
- a type variable that does not have a primary annotation in the hierarchytop
- the top annotation of the hierarchycanCombinedSetBeMissingAnnos
- whether or not- Returns:
- the result of combining
annotation
withtypeVar
-