Schnittstelle ITypeAnnotationWalker
- Alle bekannten Unterschnittstellen:
ExternalAnnotationProvider.IMethodAnnotationWalker
- Alle bekannten Implementierungsklassen:
ExternalAnnotationProvider.TypeParametersAnnotationWalker
,NonNullDefaultAwareTypeAnnotationWalker
,TypeAnnotationWalker
public interface ITypeAnnotationWalker
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.
-
Feldübersicht
Modifizierer und TypFeldBeschreibungstatic final ITypeAnnotationWalker
A no-effect annotation walker, all walking methods are implemented as identity-functions.static final IBinaryAnnotation[]
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibunggetAnnotationsAtCursor
(int currentTypeId, boolean mayApplyArrayContentsDefaultNullness) Retrieve the type annotations at the current position reached by invocations of toXYZ() methods.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.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: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 oftoTypeParameterBounds(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.
-
Felddetails
-
NO_ANNOTATIONS
-
EMPTY_ANNOTATION_WALKER
A no-effect annotation walker, all walking methods are implemented as identity-functions. At the end of any walk an empty array of annotations is returned.
-
-
Methodendetails
-
toField
ITypeAnnotationWalker toField()Walk to a field. -
toMethodReturn
ITypeAnnotationWalker toMethodReturn()Walk to the return type of a method. -
toReceiver
ITypeAnnotationWalker toReceiver()Walk to the receiver type of a method. Note: Type annotations on receiver are not currently used by the compiler. -
toTypeParameter
Walk to the type parameter of the given rank.- Parameter:
isClassTypeParameter
- whether we are looking for a class type parameter (else: method type parameter)rank
- rank of the type parameter
-
toTypeParameterBounds
Walk to the bounds of a type parameter of either a class or a method (signaled by isClassTypeParameter). Clients must then calltoTypeBound(short)
on the resulting walker.- Parameter:
isClassTypeParameter
- whether we are looking at a class type parameter (else: method type parameter)parameterRank
- rank of the type parameter.
-
toTypeBound
Detail oftoTypeParameterBounds(boolean, int)
: walk to the bounds of the previously selected type parameter.- Parameter:
boundIndex
-
-
toSupertype
Walk to the specified supertype either index based or name based:- Parameter:
index
- -1 is superclass, else index into the list of superinterfacessuperTypeSignature
- name and type arguments of the super type to visit
-
toMethodParameter
Walk to the index'th visible formal method parameter (i.e., not counting synthetic args). -
toThrows
Walk to the throws type at the given index. -
toTypeArgument
Walk to the type argument of the given rank. -
toWildcardBound
ITypeAnnotationWalker toWildcardBound()Walk to the bound of a wildcard. -
toNextArrayDimension
ITypeAnnotationWalker toNextArrayDimension()Descend down one level of array dimensions. -
toNextNestedType
ITypeAnnotationWalker toNextNestedType()Descend down one level of type nesting. -
getAnnotationsAtCursor
IBinaryAnnotation[] getAnnotationsAtCursor(int currentTypeId, boolean mayApplyArrayContentsDefaultNullness) Retrieve the type annotations at the current position reached by invocations of toXYZ() methods.- Parameter:
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.
-