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)
Replaces or adds all annotations from
from to 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, visitUnionreset, scan, scanAndReduce, visit, visit, visitNoType, visitNull, visitPrimitivepublic 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)
from to to.public static void merge(AnnotatedTypeMirror from, AnnotatedTypeMirror to, AnnotationMirror top)
protected Void compare(AnnotatedTypeMirror one, AnnotatedTypeMirror two)
AnnotatedTypeComparercompare in class AnnotatedTypeComparer<Void>protected Void combineRs(Void r1, Void r2)
AnnotatedTypeComparercombineRs in class AnnotatedTypeComparer<Void>protected void replaceAnnotations(AnnotatedTypeMirror one, AnnotatedTypeMirror two)
public Void visitTypeVariable(AnnotatedTypeMirror.AnnotatedTypeVariable from, AnnotatedTypeMirror to)
AnnotatedTypeVisitorvisitTypeVariable 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)
AnnotatedTypeVisitorvisitWildcard 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