Class KeyForPropagator
java.lang.Object
org.checkerframework.checker.nullness.KeyForPropagator
KeyForPropagator is used to move nested KeyFor annotations in type arguments from one side of a
 pseudo-assignment to the other. The KeyForPropagationTreeAnnotator details the locations in which
 this occurs.
- See Also:
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidpropagate(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, KeyForPropagator.PropagationDirection direction, AnnotatedTypeFactory typeFactory) Propagate annotations from the type arguments of one type to another.voidpropagateNewClassTree(NewClassTree newClassTree, AnnotatedTypeMirror type, KeyForAnnotatedTypeFactory atypeFactory) Propagate annotations from the type arguments oftypeto the assignment context ofnewClassTreeif one exists.
- 
Constructor Details- 
KeyForPropagatorCreates a KeyForPropagator- Parameters:
- unknownKeyfor- an- UnknownKeyForannotation
 
 
- 
- 
Method Details- 
propagatepublic void propagate(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, KeyForPropagator.PropagationDirection direction, AnnotatedTypeFactory typeFactory) Propagate annotations from the type arguments of one type to another. Which type is the source and destination of the annotations depends on the direction parameter. Only @KeyFor annotations are propagated and only if the type to which it would be propagated contains an @UnknownKeyFor or contains no key for annotations of any kind. If any of the type arguments are wildcards than they are ignored.Note the primary annotations of subtype/supertype are not used. Simple Example: 
 The type of supertype after propagate would be:typeOf(subtype) = ArrayList<@KeyFor("a") String> typeOf(supertype) = List<@UnknownKeyFor String> direction = TO_SUPERTYPEList<@KeyFor("a") String>A more complex example would be: 
 The type of subtype after propagate would be:typeOf(subtype) = HashMap<@UnknownKeyFor String, @KeyFor("b") List<@KeyFor("c") String>> typeOf(supertype) = Map<@KeyFor("a") String, @KeyFor("b") List<@KeyFor("c") String>> direction = TO_SUBTYPEHashMap<@KeyFor("a") String, @KeyFor("b") List<@KeyFor("c") String>>
- 
propagateNewClassTreepublic void propagateNewClassTree(NewClassTree newClassTree, AnnotatedTypeMirror type, KeyForAnnotatedTypeFactory atypeFactory) Propagate annotations from the type arguments oftypeto the assignment context ofnewClassTreeif one exists.- Parameters:
- newClassTree- new class tree
- type- annotated type of- newClassTree
- atypeFactory- factory
 
 
-