public class TypeVariableSubstitutor extends Object
Modifier and Type | Class and Description |
---|---|
protected class |
TypeVariableSubstitutor.Visitor |
Constructor and Description |
---|
TypeVariableSubstitutor() |
Modifier and Type | Method and Description |
---|---|
AnnotatedTypeMirror |
substitute(Map<TypeVariable,AnnotatedTypeMirror> typeParamToArg,
AnnotatedTypeMirror typeMirror)
Given a mapping between type variable's to typeArgument, replace each instance of type
variable with a copy of type argument.
|
protected AnnotatedTypeMirror |
substituteTypeVariable(AnnotatedTypeMirror argument,
AnnotatedTypeMirror.AnnotatedTypeVariable use)
Given the types of a type parameter declaration, the argument to that type parameter
declaration, and a given use of that declaration, return a substitute for the use with the
correct annotations.
|
public AnnotatedTypeMirror substitute(Map<TypeVariable,AnnotatedTypeMirror> typeParamToArg, AnnotatedTypeMirror typeMirror)
substituteTypeVariable(AnnotatedTypeMirror,
org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedTypeVariable)
protected AnnotatedTypeMirror substituteTypeVariable(AnnotatedTypeMirror argument, AnnotatedTypeMirror.AnnotatedTypeVariable use)
To determine what primary annotations are correct for the substitute the following rules are used: If the type variable use has a primary annotation then apply that primary annotation to the substitute. Otherwise, use the annotations of the argument.
argument
- the argument to declaration (this will be a value in typeParamToArg)use
- the use that is being replaced