Class AnnotatedTypeCopierWithReplacement.Visitor
- java.lang.Object
-
- org.checkerframework.framework.type.AnnotatedTypeCopier
-
- org.checkerframework.framework.type.AnnotatedTypeCopierWithReplacement.Visitor
-
- All Implemented Interfaces:
AnnotatedTypeVisitor<AnnotatedTypeMirror,java.util.IdentityHashMap<AnnotatedTypeMirror,AnnotatedTypeMirror>>
- Enclosing class:
- AnnotatedTypeCopierWithReplacement
protected static class AnnotatedTypeCopierWithReplacement.Visitor extends AnnotatedTypeCopier
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
Constructors Constructor Description Visitor(java.util.IdentityHashMap<? extends AnnotatedTypeMirror,? extends AnnotatedTypeMirror> mappings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotatedTypeMirror
visit(AnnotatedTypeMirror type)
A convenience method equivalent tov.visit(t, null)
.AnnotatedTypeMirror
visitTypeVariable(AnnotatedTypeMirror.AnnotatedTypeVariable original, java.util.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 Detail
-
Visitor
public Visitor(java.util.IdentityHashMap<? extends AnnotatedTypeMirror,? extends AnnotatedTypeMirror> mappings)
-
-
Method Detail
-
visit
public AnnotatedTypeMirror visit(AnnotatedTypeMirror type)
Description copied from interface:AnnotatedTypeVisitor
A convenience method equivalent tov.visit(t, null)
.- Specified by:
visit
in interfaceAnnotatedTypeVisitor<AnnotatedTypeMirror,java.util.IdentityHashMap<AnnotatedTypeMirror,AnnotatedTypeMirror>>
- Overrides:
visit
in classAnnotatedTypeCopier
- Parameters:
type
- the type to visit- Returns:
- a visitor-specified result
-
visitTypeVariable
public AnnotatedTypeMirror visitTypeVariable(AnnotatedTypeMirror.AnnotatedTypeVariable original, java.util.IdentityHashMap<AnnotatedTypeMirror,AnnotatedTypeMirror> originalToCopy)
Description copied from interface:AnnotatedTypeVisitor
Visits a type variable.- Specified by:
visitTypeVariable
in interfaceAnnotatedTypeVisitor<AnnotatedTypeMirror,java.util.IdentityHashMap<AnnotatedTypeMirror,AnnotatedTypeMirror>>
- Overrides:
visitTypeVariable
in classAnnotatedTypeCopier
- Parameters:
original
- the type to visitoriginalToCopy
- a visitor-specified parameter- Returns:
- a visitor-specified result
-
-