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>>
protected abstract class CFAbstractValue.AnnotationSetCombiner extends java.lang.ObjectCombines two sets of AnnotationMirrors by hierarchy.Subclasses must define how to combine sets by implementing the following methods:
combineTwoAnnotations(javax.lang.model.element.AnnotationMirror, javax.lang.model.type.TypeMirror, javax.lang.model.element.AnnotationMirror, javax.lang.model.type.TypeMirror, javax.lang.model.element.AnnotationMirror)combineAnnotationWithTypeVar(javax.lang.model.element.AnnotationMirror, org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedTypeVariable, javax.lang.model.element.AnnotationMirror, boolean)combineTwoTypeVars(org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedTypeVariable, org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedTypeVariable, javax.lang.model.element.AnnotationMirror, boolean)
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAnnotationSetCombiner()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract @Nullable javax.lang.model.element.AnnotationMirrorcombineAnnotationWithTypeVar(javax.lang.model.element.AnnotationMirror annotation, AnnotatedTypeMirror.AnnotatedTypeVariable typeVar, javax.lang.model.element.AnnotationMirror top, boolean canCombinedSetBeMissingAnnos)Returns the result of combiningannotationwithtypeVar.protected AnnotationMirrorSetcombineSets(javax.lang.model.type.TypeMirror aTypeMirror, AnnotationMirrorSet aSet, javax.lang.model.type.TypeMirror bTypeMirror, AnnotationMirrorSet bSet, boolean canCombinedSetBeMissingAnnos)Combines the two sets.protected abstract @Nullable javax.lang.model.element.AnnotationMirrorcombineTwoAnnotations(javax.lang.model.element.AnnotationMirror a, javax.lang.model.type.TypeMirror aTypeMirror, javax.lang.model.element.AnnotationMirror b, javax.lang.model.type.TypeMirror bTypeMirror, javax.lang.model.element.AnnotationMirror top)Returns the result of combining the two annotations.protected abstract @Nullable javax.lang.model.element.AnnotationMirrorcombineTwoTypeVars(AnnotatedTypeMirror.AnnotatedTypeVariable aAtv, AnnotatedTypeMirror.AnnotatedTypeVariable bAtv, javax.lang.model.element.AnnotationMirror top, boolean canCombinedSetBeMissingAnnos)Returns the primary annotation that result from of combining the twoAnnotatedTypeMirror.AnnotatedTypeVariable.
-
-
-
Method Detail
-
combineSets
protected AnnotationMirrorSet combineSets(javax.lang.model.type.TypeMirror aTypeMirror, AnnotationMirrorSet aSet, javax.lang.model.type.TypeMirror bTypeMirror, AnnotationMirrorSet bSet, boolean canCombinedSetBeMissingAnnos)
Combines the two sets.- Parameters:
aTypeMirror- the type mirror associated withaSetaSet- a set of annotation mirrorsbTypeMirror- the type mirror associated withbSetbSet- a set of annotation mirrorscanCombinedSetBeMissingAnnos- whether or not the combined set can be missing annotations- Returns:
- the combined sets
-
combineTwoAnnotations
protected abstract @Nullable javax.lang.model.element.AnnotationMirror combineTwoAnnotations(javax.lang.model.element.AnnotationMirror a, javax.lang.model.type.TypeMirror aTypeMirror, javax.lang.model.element.AnnotationMirror b, javax.lang.model.type.TypeMirror bTypeMirror, javax.lang.model.element.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 hierarchyaTypeMirror- the type that is annotated byab- an annotation in the hierarchybTypeMirror- the type that is annotated bybtop- the top annotation in the hierarchy- Returns:
- the result of combining the two annotations or null if no combination exists
-
combineTwoTypeVars
protected abstract @Nullable javax.lang.model.element.AnnotationMirror combineTwoTypeVars(AnnotatedTypeMirror.AnnotatedTypeVariable aAtv, AnnotatedTypeMirror.AnnotatedTypeVariable bAtv, javax.lang.model.element.AnnotationMirror top, boolean canCombinedSetBeMissingAnnos)
Returns the primary annotation that result from of combining the twoAnnotatedTypeMirror.AnnotatedTypeVariable. If the result has no primary annotation,nullis 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 intophierarchybAtv- a type variable that does not have a primary annotation intophierarchytop- the top annotation in the hierarchycanCombinedSetBeMissingAnnos- whether or not- Returns:
- the result of combining the two type variables, which may be null
-
combineAnnotationWithTypeVar
protected abstract @Nullable javax.lang.model.element.AnnotationMirror combineAnnotationWithTypeVar(javax.lang.model.element.AnnotationMirror annotation, AnnotatedTypeMirror.AnnotatedTypeVariable typeVar, javax.lang.model.element.AnnotationMirror top, boolean canCombinedSetBeMissingAnnos)
Returns the result of combiningannotationwithtypeVar.This is called when an annotation exists for the hierarchy in one 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
annotationwithtypeVar
-
-