Class AnnotatedTypeCopierWithReplacement.Visitor
java.lang.Object
org.checkerframework.framework.type.AnnotatedTypeCopier
org.checkerframework.framework.type.AnnotatedTypeCopierWithReplacement.Visitor
- All Implemented Interfaces:
AnnotatedTypeVisitor<AnnotatedTypeMirror,IdentityHashMap<AnnotatedTypeMirror, AnnotatedTypeMirror>>
- Enclosing class:
AnnotatedTypeCopierWithReplacement
AnnotatedTypeCopier maintains a mapping of typeVisited => copyOfTypeVisited When a
reference, typeVisited, is encountered again, it will use the recorded reference,
copyOfTypeVisited, instead of generating a new copy of typeVisited. Visitor pre-populates this
mapping so that references are replaced not by their copies but by those in the replacementMap
provided in the constructor.
All types NOT in the replacement map are duplicated as per AnnotatedTypeCopier.visit
-
Field Summary
Fields inherited from class org.checkerframework.framework.type.AnnotatedTypeCopier
copyAnnotations, visitingExecutableTypeParam -
Constructor Summary
ConstructorsConstructorDescriptionVisitor(IdentityHashMap<? extends AnnotatedTypeMirror, ? extends AnnotatedTypeMirror> mappings) -
Method Summary
Modifier and TypeMethodDescriptionvisit(AnnotatedTypeMirror type) A convenience method equivalent tov.visit(t, null).visitTypeVariable(AnnotatedTypeMirror.AnnotatedTypeVariable original, IdentityHashMap<AnnotatedTypeMirror, AnnotatedTypeMirror> originalToCopy) Visits a type variable.Methods inherited from class org.checkerframework.framework.type.AnnotatedTypeCopier
makeCopy, makeOrReturnCopy, maybeCopyPrimaryAnnotations, visit, visitArray, visitDeclared, visitExecutable, visitIntersection, visitNoType, visitNull, visitPrimitive, visitUnion, visitWildcard
-
Constructor Details
-
Visitor
public Visitor(IdentityHashMap<? extends AnnotatedTypeMirror, ? extends AnnotatedTypeMirror> mappings)
-
-
Method Details
-
visit
Description copied from interface:AnnotatedTypeVisitorA convenience method equivalent tov.visit(t, null).- Specified by:
visitin interfaceAnnotatedTypeVisitor<AnnotatedTypeMirror,IdentityHashMap<AnnotatedTypeMirror, AnnotatedTypeMirror>> - Overrides:
visitin classAnnotatedTypeCopier- Parameters:
type- the type to visit- Returns:
- a visitor-specified result
-
visitTypeVariable
public AnnotatedTypeMirror visitTypeVariable(AnnotatedTypeMirror.AnnotatedTypeVariable original, IdentityHashMap<AnnotatedTypeMirror, AnnotatedTypeMirror> originalToCopy) Description copied from interface:AnnotatedTypeVisitorVisits a type variable.- Specified by:
visitTypeVariablein interfaceAnnotatedTypeVisitor<AnnotatedTypeMirror,IdentityHashMap<AnnotatedTypeMirror, AnnotatedTypeMirror>> - Overrides:
visitTypeVariablein classAnnotatedTypeCopier- Parameters:
original- the type to visitoriginalToCopy- a visitor-specified parameter- Returns:
- a visitor-specified result
-