Class TypeAnnotationWalker
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.TypeAnnotationWalker
- All Implemented Interfaces:
ITypeAnnotationWalker
- Direct Known Subclasses:
NonNullDefaultAwareTypeAnnotationWalker
Type annotation walker implementation based an actual annotations decoded from a .class file.
-
Field Summary
FieldsFields inherited from interface org.aspectj.org.eclipse.jdt.internal.compiler.env.ITypeAnnotationWalker
EMPTY_ANNOTATION_WALKER, NO_ANNOTATIONS -
Constructor Summary
ConstructorsModifierConstructorDescriptionTypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations)protectedTypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations, long matchBits, int pathPtr) -
Method Summary
Modifier and TypeMethodDescriptiongetAnnotationsAtCursor(int currentTypeId, boolean mayApplyArrayContentsDefaultNullness)Retrieve the type annotations at the current position reached by invocations of toXYZ() methods.protected ITypeAnnotationWalkerrestrict(long newMatches, int newPathPtr)toField()Walk to a field.toMethodParameter(short index)Walk to the index'th visible formal method parameter (i.e., not counting synthetic args).Walk to the return type of a method.Descend down one level of array dimensions.protected ITypeAnnotationWalkertoNextDetail(int detailKind)Descend down one level of type nesting.Walk to the receiver type of a method.toSupertype(short index, char[] superTypeSignature)Walk to the specified supertype either index based or name based:protected ITypeAnnotationWalkertoTarget(int targetType)toThrows(int index)Walk to the throws type at the given index.toTypeArgument(int rank)Walk to the type argument of the given rank.toTypeBound(short boundIndex)Detail ofITypeAnnotationWalker.toTypeParameterBounds(boolean, int): walk to the bounds of the previously selected type parameter.toTypeParameter(boolean isClassTypeParameter, int rank)Walk to the type parameter of the given rank.toTypeParameterBounds(boolean isClassTypeParameter, int parameterRank)Walk to the bounds of a type parameter of either a class or a method (signaled by isClassTypeParameter).Walk to the bound of a wildcard.
-
Field Details
-
typeAnnotations
-
matches
protected final long matches -
pathPtr
protected final int pathPtr
-
-
Constructor Details
-
TypeAnnotationWalker
-
TypeAnnotationWalker
protected TypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations, long matchBits, int pathPtr)
-
-
Method Details
-
restrict
-
toField
Description copied from interface:ITypeAnnotationWalkerWalk to a field.- Specified by:
toFieldin interfaceITypeAnnotationWalker
-
toMethodReturn
Description copied from interface:ITypeAnnotationWalkerWalk to the return type of a method.- Specified by:
toMethodReturnin interfaceITypeAnnotationWalker
-
toReceiver
Description copied from interface:ITypeAnnotationWalkerWalk to the receiver type of a method. Note: Type annotations on receiver are not currently used by the compiler.- Specified by:
toReceiverin interfaceITypeAnnotationWalker
-
toTarget
-
toTypeParameter
Description copied from interface:ITypeAnnotationWalkerWalk to the type parameter of the given rank.- Specified by:
toTypeParameterin interfaceITypeAnnotationWalker- Parameters:
isClassTypeParameter- whether we are looking for a class type parameter (else: method type parameter)rank- rank of the type parameter
-
toTypeParameterBounds
public ITypeAnnotationWalker toTypeParameterBounds(boolean isClassTypeParameter, int parameterRank)Description copied from interface:ITypeAnnotationWalkerWalk to the bounds of a type parameter of either a class or a method (signaled by isClassTypeParameter). Clients must then callITypeAnnotationWalker.toTypeBound(short)on the resulting walker.- Specified by:
toTypeParameterBoundsin interfaceITypeAnnotationWalker- Parameters:
isClassTypeParameter- whether we are looking at a class type parameter (else: method type parameter)parameterRank- rank of the type parameter.
-
toTypeBound
Description copied from interface:ITypeAnnotationWalkerDetail ofITypeAnnotationWalker.toTypeParameterBounds(boolean, int): walk to the bounds of the previously selected type parameter.- Specified by:
toTypeBoundin interfaceITypeAnnotationWalker
-
toSupertype
Walk to the specified supertype either index based or name based:(superTypesSignature is ignored in this implementation).
- Specified by:
toSupertypein interfaceITypeAnnotationWalker- Parameters:
index- -1 is superclass, else index into the list of superinterfacessuperTypeSignature- name and type arguments of the super type to visit
-
toMethodParameter
Description copied from interface:ITypeAnnotationWalkerWalk to the index'th visible formal method parameter (i.e., not counting synthetic args).- Specified by:
toMethodParameterin interfaceITypeAnnotationWalker
-
toThrows
Description copied from interface:ITypeAnnotationWalkerWalk to the throws type at the given index.- Specified by:
toThrowsin interfaceITypeAnnotationWalker
-
toTypeArgument
Description copied from interface:ITypeAnnotationWalkerWalk to the type argument of the given rank.- Specified by:
toTypeArgumentin interfaceITypeAnnotationWalker
-
toWildcardBound
Description copied from interface:ITypeAnnotationWalkerWalk to the bound of a wildcard.- Specified by:
toWildcardBoundin interfaceITypeAnnotationWalker
-
toNextArrayDimension
Description copied from interface:ITypeAnnotationWalkerDescend down one level of array dimensions.- Specified by:
toNextArrayDimensionin interfaceITypeAnnotationWalker
-
toNextNestedType
Description copied from interface:ITypeAnnotationWalkerDescend down one level of type nesting.- Specified by:
toNextNestedTypein interfaceITypeAnnotationWalker
-
toNextDetail
-
getAnnotationsAtCursor
public IBinaryAnnotation[] getAnnotationsAtCursor(int currentTypeId, boolean mayApplyArrayContentsDefaultNullness)Description copied from interface:ITypeAnnotationWalkerRetrieve the type annotations at the current position reached by invocations of toXYZ() methods.- Specified by:
getAnnotationsAtCursorin interfaceITypeAnnotationWalker- Parameters:
currentTypeId- 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.
-