public class AnnotatedTypeMerger extends AnnotatedTypeComparer<Void>
Example use:
AnnotatedTypeMirror visitType = ...;
AnnotatedTypeMirror parameter = ...;
visitType.accept(new AnnotatedTypesMerger(), parameter);
visitedNodes
Constructor and Description |
---|
AnnotatedTypeMerger() |
AnnotatedTypeMerger(AnnotationMirror top) |
Modifier and Type | Method and Description |
---|---|
protected Void |
combineRs(Void r1,
Void r2)
Supplies the logic to reduce on how to combine two R objects
|
protected Void |
compare(AnnotatedTypeMirror one,
AnnotatedTypeMirror two)
Compares two annotated type mirrors.
|
static void |
merge(AnnotatedTypeMirror from,
AnnotatedTypeMirror to) |
static void |
merge(AnnotatedTypeMirror from,
AnnotatedTypeMirror to,
AnnotationMirror top) |
protected void |
replaceAnnotations(AnnotatedTypeMirror one,
AnnotatedTypeMirror two) |
void |
resolvePrimaries(AnnotatedTypeMirror from,
AnnotatedTypeMirror to)
For type variables and wildcards, the absence of a primary annotations has an implied meaning
on substitution.
|
Void |
visitTypeVariable(AnnotatedTypeMirror.AnnotatedTypeVariable from,
AnnotatedTypeMirror to)
Visits a type variable.
|
Void |
visitWildcard(AnnotatedTypeMirror.AnnotatedWildcardType from,
AnnotatedTypeMirror to)
Visits a wildcard type.
|
reduce, scan, scan, scanAndReduce, scanAndReduce, visitArray, visitDeclared, visitExecutable, visitIntersection, visitUnion
reset, scan, scanAndReduce, visit, visit, visitNoType, visitNull, visitPrimitive
public AnnotatedTypeMerger()
public AnnotatedTypeMerger(AnnotationMirror top)
top
- if top != null, then only annotation in the hierarchy of top are affected by this
mergerpublic static void merge(AnnotatedTypeMirror from, AnnotatedTypeMirror to)
public static void merge(AnnotatedTypeMirror from, AnnotatedTypeMirror to, AnnotationMirror top)
protected Void compare(AnnotatedTypeMirror one, AnnotatedTypeMirror two)
AnnotatedTypeComparer
compare
in class AnnotatedTypeComparer<Void>
protected Void combineRs(Void r1, Void r2)
AnnotatedTypeComparer
combineRs
in class AnnotatedTypeComparer<Void>
protected void replaceAnnotations(AnnotatedTypeMirror one, AnnotatedTypeMirror two)
public Void visitTypeVariable(AnnotatedTypeMirror.AnnotatedTypeVariable from, AnnotatedTypeMirror to)
AnnotatedTypeVisitor
visitTypeVariable
in interface AnnotatedTypeVisitor<Void,AnnotatedTypeMirror>
visitTypeVariable
in class AnnotatedTypeComparer<Void>
from
- the type to visitto
- a visitor-specified parameterpublic Void visitWildcard(AnnotatedTypeMirror.AnnotatedWildcardType from, AnnotatedTypeMirror to)
AnnotatedTypeVisitor
visitWildcard
in interface AnnotatedTypeVisitor<Void,AnnotatedTypeMirror>
visitWildcard
in class AnnotatedTypeComparer<Void>
from
- the type to visitto
- a visitor-specified parameterpublic void resolvePrimaries(AnnotatedTypeMirror from, AnnotatedTypeMirror to)
from
- a type variable or wildcard