|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.aspectj.org.eclipse.jdt.internal.compiler.classfmt.TypeAnnotationWalker
public class TypeAnnotationWalker
A TypeAnnotationWalker is initialized with all type annotations found at a given element. It can be used to walk into the types at the given element and finally answer the actual annotations at any node of the walk. The walker is implemented as immutable objects. During the walk either new instances are created, or the current instance is shared if no difference is encountered.
| Field Summary | |
|---|---|
static TypeAnnotationWalker |
EMPTY_ANNOTATION_WALKER
A no-effect annotation walker, all walking methods are implemented as identity-functions. |
protected long |
matches
|
static IBinaryAnnotation[] |
NO_ANNOTATIONS
|
protected int |
pathPtr
|
protected IBinaryTypeAnnotation[] |
typeAnnotations
|
| Constructor Summary | |
|---|---|
|
TypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations)
|
protected |
TypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations,
long matchBits,
int pathPtr)
|
| Method Summary | |
|---|---|
IBinaryAnnotation[] |
getAnnotationsAtCursor(int currentTypeId)
Retrieve the type annotations at the current position reached by invocations of toXYZ() methods. |
protected TypeAnnotationWalker |
restrict(long newMatches,
int newPathPtr)
|
TypeAnnotationWalker |
toField()
Walk to a field. |
TypeAnnotationWalker |
toMethodParameter(short index)
Walk to the index'th visible formal method parameter (i.e., not counting synthetic args). |
TypeAnnotationWalker |
toMethodReturn()
Walk to the return type of a method. |
TypeAnnotationWalker |
toNextArrayDimension()
Descend down one level of array dimensions. |
protected TypeAnnotationWalker |
toNextDetail(int detailKind)
|
TypeAnnotationWalker |
toNextNestedType()
Descend down one level of type nesting. |
TypeAnnotationWalker |
toReceiver()
Walk to the receiver type of a method. |
TypeAnnotationWalker |
toSupertype(short index)
Walk to the specified supertype: -1 is superclass, else the superinterface at the given index. |
protected TypeAnnotationWalker |
toTarget(int targetType)
|
TypeAnnotationWalker |
toThrows(int index)
Walk to the throws type at the given index. |
TypeAnnotationWalker |
toTypeArgument(int rank)
Walk to the type argument of the given rank. |
TypeAnnotationWalker |
toTypeBound(short boundIndex)
Detail of toTypeParameterBounds(boolean, int): walk to the bounds
of the previously selected type parameter. |
TypeAnnotationWalker |
toTypeParameter(boolean isClassTypeParameter,
int rank)
Walk to the type parameter of the given rank. |
TypeAnnotationWalker |
toTypeParameterBounds(boolean isClassTypeParameter,
int parameterRank)
Walk to the bounds of a type parameter of either a class or a method (signaled by isClassTypeParameter). |
TypeAnnotationWalker |
toWildcardBound()
Walk to the bound of a wildcard. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final IBinaryAnnotation[] NO_ANNOTATIONS
public static final TypeAnnotationWalker EMPTY_ANNOTATION_WALKER
protected final IBinaryTypeAnnotation[] typeAnnotations
protected final long matches
protected final int pathPtr
| Constructor Detail |
|---|
public TypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations)
protected TypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations,
long matchBits,
int pathPtr)
| Method Detail |
|---|
protected TypeAnnotationWalker restrict(long newMatches,
int newPathPtr)
public TypeAnnotationWalker toField()
public TypeAnnotationWalker toMethodReturn()
public TypeAnnotationWalker toReceiver()
protected TypeAnnotationWalker toTarget(int targetType)
public TypeAnnotationWalker toTypeParameter(boolean isClassTypeParameter,
int rank)
isClassTypeParameter - whether we are looking for a class type parameter (else: method type type parameter)rank - rank of the type parameter
public TypeAnnotationWalker toTypeParameterBounds(boolean isClassTypeParameter,
int parameterRank)
toTypeBound(short) on the resulting walker.
isClassTypeParameter - whether we are looking at a class type parameter (else: method type type parameter)parameterRank - rank of the type parameter.public TypeAnnotationWalker toTypeBound(short boundIndex)
toTypeParameterBounds(boolean, int): walk to the bounds
of the previously selected type parameter.
boundIndex - public TypeAnnotationWalker toSupertype(short index)
public TypeAnnotationWalker toMethodParameter(short index)
public TypeAnnotationWalker toThrows(int index)
public TypeAnnotationWalker toTypeArgument(int rank)
public TypeAnnotationWalker toWildcardBound()
public TypeAnnotationWalker toNextArrayDimension()
public TypeAnnotationWalker toNextNestedType()
protected TypeAnnotationWalker toNextDetail(int detailKind)
public IBinaryAnnotation[] getAnnotationsAtCursor(int currentTypeId)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||