public class TypeAnnotationWalker extends java.lang.Object implements ITypeAnnotationWalker
| Modifier and Type | Field and Description |
|---|---|
protected long |
matches |
protected int |
pathPtr |
protected IBinaryTypeAnnotation[] |
typeAnnotations |
EMPTY_ANNOTATION_WALKER, NO_ANNOTATIONS| Modifier | Constructor and Description |
|---|---|
|
TypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations) |
protected |
TypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations,
long matchBits,
int pathPtr) |
| Modifier and Type | Method and Description |
|---|---|
IBinaryAnnotation[] |
getAnnotationsAtCursor(int currentTypeId)
Retrieve the type annotations at the current position
reached by invocations of toXYZ() methods.
|
protected ITypeAnnotationWalker |
restrict(long newMatches,
int newPathPtr) |
ITypeAnnotationWalker |
toField()
Walk to a field.
|
ITypeAnnotationWalker |
toMethodParameter(short index)
Walk to the index'th visible formal method parameter (i.e., not counting synthetic args).
|
ITypeAnnotationWalker |
toMethodReturn()
Walk to the return type of a method.
|
ITypeAnnotationWalker |
toNextArrayDimension()
Descend down one level of array dimensions.
|
protected ITypeAnnotationWalker |
toNextDetail(int detailKind) |
ITypeAnnotationWalker |
toNextNestedType()
Descend down one level of type nesting.
|
ITypeAnnotationWalker |
toReceiver()
Walk to the receiver type of a method.
|
ITypeAnnotationWalker |
toSupertype(short index,
char[] superTypeSignature)
Walk to the specified supertype either index based or name based:
|
protected ITypeAnnotationWalker |
toTarget(int targetType) |
ITypeAnnotationWalker |
toThrows(int index)
Walk to the throws type at the given index.
|
ITypeAnnotationWalker |
toTypeArgument(int rank)
Walk to the type argument of the given rank.
|
ITypeAnnotationWalker |
toTypeBound(short boundIndex)
Detail of
ITypeAnnotationWalker.toTypeParameterBounds(boolean, int): walk to the bounds
of the previously selected type parameter. |
ITypeAnnotationWalker |
toTypeParameter(boolean isClassTypeParameter,
int rank)
Walk to the type parameter of the given rank.
|
ITypeAnnotationWalker |
toTypeParameterBounds(boolean isClassTypeParameter,
int parameterRank)
Walk to the bounds of a type parameter of either a class or a method (signaled by isClassTypeParameter).
|
ITypeAnnotationWalker |
toWildcardBound()
Walk to the bound of a wildcard.
|
protected final IBinaryTypeAnnotation[] typeAnnotations
protected final long matches
protected final int pathPtr
public TypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations)
protected TypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations, long matchBits, int pathPtr)
protected ITypeAnnotationWalker restrict(long newMatches, int newPathPtr)
public ITypeAnnotationWalker toField()
ITypeAnnotationWalkertoField in interface ITypeAnnotationWalkerpublic ITypeAnnotationWalker toMethodReturn()
ITypeAnnotationWalkertoMethodReturn in interface ITypeAnnotationWalkerpublic ITypeAnnotationWalker toReceiver()
ITypeAnnotationWalkertoReceiver in interface ITypeAnnotationWalkerprotected ITypeAnnotationWalker toTarget(int targetType)
public ITypeAnnotationWalker toTypeParameter(boolean isClassTypeParameter, int rank)
ITypeAnnotationWalkertoTypeParameter in interface ITypeAnnotationWalkerisClassTypeParameter - whether we are looking for a class type parameter (else: method type parameter)rank - rank of the type parameterpublic ITypeAnnotationWalker toTypeParameterBounds(boolean isClassTypeParameter, int parameterRank)
ITypeAnnotationWalkerITypeAnnotationWalker.toTypeBound(short) on the resulting walker.toTypeParameterBounds in interface ITypeAnnotationWalkerisClassTypeParameter - whether we are looking at a class type parameter (else: method type parameter)parameterRank - rank of the type parameter.public ITypeAnnotationWalker toTypeBound(short boundIndex)
ITypeAnnotationWalkerITypeAnnotationWalker.toTypeParameterBounds(boolean, int): walk to the bounds
of the previously selected type parameter.toTypeBound in interface ITypeAnnotationWalkerpublic ITypeAnnotationWalker toSupertype(short index, char[] superTypeSignature)
(superTypesSignature is ignored in this implementation).
toSupertype in interface ITypeAnnotationWalkerindex - -1 is superclass, else index into the list of superinterfacessuperTypeSignature - name and type arguments of the super type to visitpublic ITypeAnnotationWalker toMethodParameter(short index)
ITypeAnnotationWalkertoMethodParameter in interface ITypeAnnotationWalkerpublic ITypeAnnotationWalker toThrows(int index)
ITypeAnnotationWalkertoThrows in interface ITypeAnnotationWalkerpublic ITypeAnnotationWalker toTypeArgument(int rank)
ITypeAnnotationWalkertoTypeArgument in interface ITypeAnnotationWalkerpublic ITypeAnnotationWalker toWildcardBound()
ITypeAnnotationWalkertoWildcardBound in interface ITypeAnnotationWalkerpublic ITypeAnnotationWalker toNextArrayDimension()
ITypeAnnotationWalkertoNextArrayDimension in interface ITypeAnnotationWalkerpublic ITypeAnnotationWalker toNextNestedType()
ITypeAnnotationWalkertoNextNestedType in interface ITypeAnnotationWalkerprotected ITypeAnnotationWalker toNextDetail(int detailKind)
public IBinaryAnnotation[] getAnnotationsAtCursor(int currentTypeId)
ITypeAnnotationWalkergetAnnotationsAtCursor in interface ITypeAnnotationWalkercurrentTypeId - the id of the type being annotated; 0 signals don't care / unknown;
-1 signals if annotating a wildcard or a use of a type variable.