org.aspectj.org.eclipse.jdt.internal.compiler.classfmt
Class NonNullDefaultAwareTypeAnnotationWalker

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.TypeAnnotationWalker
      extended by org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.NonNullDefaultAwareTypeAnnotationWalker

public class NonNullDefaultAwareTypeAnnotationWalker
extends TypeAnnotationWalker

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
EMPTY_ANNOTATION_WALKER, matches, NO_ANNOTATIONS, pathPtr, typeAnnotations
 
Constructor Summary
NonNullDefaultAwareTypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations, int defaultNullness, LookupEnvironment environment)
          Create initial walker with non-empty type annotations.
NonNullDefaultAwareTypeAnnotationWalker(int defaultNullness, LookupEnvironment environment)
          Create an initial walker without 'real' type annotations, but with a nonnull default.
 
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 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 toTypeArgument(int rank)
          Walk to the type argument of the given rank.
 TypeAnnotationWalker toTypeBound(short boundIndex)
          Detail of TypeAnnotationWalker.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).
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.TypeAnnotationWalker
toField, toNextArrayDimension, toNextDetail, toNextNestedType, toReceiver, toSupertype, toTarget, toThrows, toWildcardBound
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NonNullDefaultAwareTypeAnnotationWalker

public NonNullDefaultAwareTypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations,
                                               int defaultNullness,
                                               LookupEnvironment environment)
Create initial walker with non-empty type annotations.


NonNullDefaultAwareTypeAnnotationWalker

public NonNullDefaultAwareTypeAnnotationWalker(int defaultNullness,
                                               LookupEnvironment environment)
Create an initial walker without 'real' type annotations, but with a nonnull default.

Method Detail

restrict

protected TypeAnnotationWalker restrict(long newMatches,
                                        int newPathPtr)
Overrides:
restrict in class TypeAnnotationWalker

toMethodParameter

public TypeAnnotationWalker toMethodParameter(short index)
Description copied from class: TypeAnnotationWalker
Walk to the index'th visible formal method parameter (i.e., not counting synthetic args).

Overrides:
toMethodParameter in class TypeAnnotationWalker

toMethodReturn

public TypeAnnotationWalker toMethodReturn()
Description copied from class: TypeAnnotationWalker
Walk to the return type of a method.

Overrides:
toMethodReturn in class TypeAnnotationWalker

toTypeBound

public TypeAnnotationWalker toTypeBound(short boundIndex)
Description copied from class: TypeAnnotationWalker
Detail of TypeAnnotationWalker.toTypeParameterBounds(boolean, int): walk to the bounds of the previously selected type parameter.

Overrides:
toTypeBound in class TypeAnnotationWalker

toTypeParameterBounds

public TypeAnnotationWalker toTypeParameterBounds(boolean isClassTypeParameter,
                                                  int parameterRank)
Description copied from class: TypeAnnotationWalker
Walk to the bounds of a type parameter of either a class or a method (signaled by isClassTypeParameter). Clients must then call TypeAnnotationWalker.toTypeBound(short) on the resulting walker.

Overrides:
toTypeParameterBounds in class TypeAnnotationWalker
Parameters:
isClassTypeParameter - whether we are looking at a class type parameter (else: method type type parameter)
parameterRank - rank of the type parameter.

toTypeArgument

public TypeAnnotationWalker toTypeArgument(int rank)
Description copied from class: TypeAnnotationWalker
Walk to the type argument of the given rank.

Overrides:
toTypeArgument in class TypeAnnotationWalker

toTypeParameter

public TypeAnnotationWalker toTypeParameter(boolean isClassTypeParameter,
                                            int rank)
Description copied from class: TypeAnnotationWalker
Walk to the type parameter of the given rank.

Overrides:
toTypeParameter in class TypeAnnotationWalker
Parameters:
isClassTypeParameter - whether we are looking for a class type parameter (else: method type type parameter)
rank - rank of the type parameter

getAnnotationsAtCursor

public IBinaryAnnotation[] getAnnotationsAtCursor(int currentTypeId)
Description copied from class: TypeAnnotationWalker
Retrieve the type annotations at the current position reached by invocations of toXYZ() methods.

Overrides:
getAnnotationsAtCursor in class TypeAnnotationWalker