Class NonNullDefaultAwareTypeAnnotationWalker
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.TypeAnnotationWalker
org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.NonNullDefaultAwareTypeAnnotationWalker
- All Implemented Interfaces:
ITypeAnnotationWalker
A type annotation walker that adds missing NonNull annotations according to the current default.
-
Field Summary
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.TypeAnnotationWalker
matches, pathPtr, typeAnnotations
Fields inherited from interface org.aspectj.org.eclipse.jdt.internal.compiler.env.ITypeAnnotationWalker
EMPTY_ANNOTATION_WALKER, NO_ANNOTATIONS
-
Constructor Summary
ConstructorsConstructorDescriptionNonNullDefaultAwareTypeAnnotationWalker
(int defaultNullness, LookupEnvironment environment) Create an initial walker without 'real' type annotations, but with a nonnull default.NonNullDefaultAwareTypeAnnotationWalker
(IBinaryTypeAnnotation[] typeAnnotations, int defaultNullness, LookupEnvironment environment) Create initial walker with non-empty type annotations. -
Method Summary
Modifier and TypeMethodDescriptiongetAnnotationsAtCursor
(int currentTypeId, boolean mayApplyArrayContentsDefaultNullness) Retrieve the type annotations at the current position reached by invocations of toXYZ() methods.protected TypeAnnotationWalker
restrict
(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 ITypeAnnotationWalker
toNextDetail
(int detailKind) toSupertype
(short index, char[] superTypeSignature) Walk to the specified supertype either index based or name based: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.static ITypeAnnotationWalker
updateWalkerForParamNonNullDefault
(ITypeAnnotationWalker walker, int defaultNullness, LookupEnvironment environment) Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.TypeAnnotationWalker
toNextNestedType, toReceiver, toTarget, toThrows
-
Constructor Details
-
NonNullDefaultAwareTypeAnnotationWalker
public NonNullDefaultAwareTypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations, int defaultNullness, LookupEnvironment environment) Create initial walker with non-empty type annotations. -
NonNullDefaultAwareTypeAnnotationWalker
Create an initial walker without 'real' type annotations, but with a nonnull default.
-
-
Method Details
-
restrict
- Overrides:
restrict
in classTypeAnnotationWalker
-
toSupertype
Description copied from class:TypeAnnotationWalker
Walk to the specified supertype either index based or name based:(superTypesSignature is ignored in this implementation).
- Specified by:
toSupertype
in interfaceITypeAnnotationWalker
- Overrides:
toSupertype
in classTypeAnnotationWalker
- 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:ITypeAnnotationWalker
Walk to the index'th visible formal method parameter (i.e., not counting synthetic args).- Specified by:
toMethodParameter
in interfaceITypeAnnotationWalker
- Overrides:
toMethodParameter
in classTypeAnnotationWalker
-
toField
Description copied from interface:ITypeAnnotationWalker
Walk to a field.- Specified by:
toField
in interfaceITypeAnnotationWalker
- Overrides:
toField
in classTypeAnnotationWalker
-
toMethodReturn
Description copied from interface:ITypeAnnotationWalker
Walk to the return type of a method.- Specified by:
toMethodReturn
in interfaceITypeAnnotationWalker
- Overrides:
toMethodReturn
in classTypeAnnotationWalker
-
toTypeBound
Description copied from interface:ITypeAnnotationWalker
Detail ofITypeAnnotationWalker.toTypeParameterBounds(boolean, int)
: walk to the bounds of the previously selected type parameter.- Specified by:
toTypeBound
in interfaceITypeAnnotationWalker
- Overrides:
toTypeBound
in classTypeAnnotationWalker
-
toWildcardBound
Description copied from interface:ITypeAnnotationWalker
Walk to the bound of a wildcard.- Specified by:
toWildcardBound
in interfaceITypeAnnotationWalker
- Overrides:
toWildcardBound
in classTypeAnnotationWalker
-
toTypeParameterBounds
Description copied from interface:ITypeAnnotationWalker
Walk 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:
toTypeParameterBounds
in interfaceITypeAnnotationWalker
- Overrides:
toTypeParameterBounds
in classTypeAnnotationWalker
- Parameters:
isClassTypeParameter
- whether we are looking at a class type parameter (else: method type parameter)parameterRank
- rank of the type parameter.
-
toTypeArgument
Description copied from interface:ITypeAnnotationWalker
Walk to the type argument of the given rank.- Specified by:
toTypeArgument
in interfaceITypeAnnotationWalker
- Overrides:
toTypeArgument
in classTypeAnnotationWalker
-
toTypeParameter
Description copied from interface:ITypeAnnotationWalker
Walk to the type parameter of the given rank.- Specified by:
toTypeParameter
in interfaceITypeAnnotationWalker
- Overrides:
toTypeParameter
in classTypeAnnotationWalker
- Parameters:
isClassTypeParameter
- whether we are looking for a class type parameter (else: method type parameter)rank
- rank of the type parameter
-
toNextDetail
- Overrides:
toNextDetail
in classTypeAnnotationWalker
-
getAnnotationsAtCursor
public IBinaryAnnotation[] getAnnotationsAtCursor(int currentTypeId, boolean mayApplyArrayContentsDefaultNullness) Description copied from interface:ITypeAnnotationWalker
Retrieve the type annotations at the current position reached by invocations of toXYZ() methods.- Specified by:
getAnnotationsAtCursor
in interfaceITypeAnnotationWalker
- Overrides:
getAnnotationsAtCursor
in classTypeAnnotationWalker
- 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.
-
toNextArrayDimension
Description copied from interface:ITypeAnnotationWalker
Descend down one level of array dimensions.- Specified by:
toNextArrayDimension
in interfaceITypeAnnotationWalker
- Overrides:
toNextArrayDimension
in classTypeAnnotationWalker
-
updateWalkerForParamNonNullDefault
public static ITypeAnnotationWalker updateWalkerForParamNonNullDefault(ITypeAnnotationWalker walker, int defaultNullness, LookupEnvironment environment)
-