Class ArrayTypeReference

All Implemented Interfaces:
TypeConstants, TypeIds
Direct Known Subclasses:
JavadocArraySingleTypeReference, ParameterizedSingleTypeReference

public class ArrayTypeReference extends SingleTypeReference
  • Field Details

    • dimensions

      public int dimensions
    • originalSourceEnd

      public int originalSourceEnd
    • extendedDimensions

      public int extendedDimensions
    • leafComponentTypeWithoutDefaultNullness

      public TypeBinding leafComponentTypeWithoutDefaultNullness
  • Constructor Details

    • ArrayTypeReference

      public ArrayTypeReference(char[] source, int dimensions, long pos)
      ArrayTypeReference constructor comment.
      Parameters:
      source - char[]
      dimensions - int
      pos - int
    • ArrayTypeReference

      public ArrayTypeReference(char[] source, int dimensions, Annotation[][] annotationsOnDimensions, long pos)
  • Method Details

    • dimensions

      public int dimensions()
      Overrides:
      dimensions in class TypeReference
    • extraDimensions

      public int extraDimensions()
      Description copied from class: TypeReference
      This method is used to return the array dimension declared after the name of a local or a field declaration. For example: int i, j[] = null, k[][] = {{}}; It should return 0 for i, 1 for j and 2 for k.
      Overrides:
      extraDimensions in class TypeReference
      Returns:
      int the extra dimension found
    • getAnnotationsOnDimensions

      public Annotation[][] getAnnotationsOnDimensions(boolean useSourceOrder)
      Overrides:
      getAnnotationsOnDimensions in class TypeReference
      Parameters:
      useSourceOrder - if true annotations on dimensions are returned in source order, otherwise they are returned per how they ought to be interpreted by a type system, or external persistence view. For example, given the following: int @Nullable [] f @NonNull [] ==> f is really a @NonNull array of @Nullable arrays of ints. This is the type system view since extended dimensions bind more readily than type components that precede the identifier. This is how it ought to be encoded in bindings and how it ought to be persisted in class files. However for DOM/AST construction, we need the dimensions in source order, so we provide a way for the clients to ask what they want.
      See Also:
      • invalid reference
        org.eclipse.jdt.internal.compiler.ast.TypeReference#getAnnotationsOnDimensions(boolean)
    • setAnnotationsOnDimensions

      public void setAnnotationsOnDimensions(Annotation[][] annotationsOnDimensions)
      Overrides:
      setAnnotationsOnDimensions in class TypeReference
    • getTopAnnotations

      public Annotation[] getTopAnnotations()
      Overrides:
      getTopAnnotations in class TypeReference
    • getParameterizedTypeName

      public char[][] getParameterizedTypeName()
      Overrides:
      getParameterizedTypeName in class TypeReference
      Returns:
      char[][]
    • getTypeBinding

      protected TypeBinding getTypeBinding(Scope scope)
      Overrides:
      getTypeBinding in class SingleTypeReference
    • printExpression

      public StringBuilder printExpression(int indent, StringBuilder output)
      Overrides:
      printExpression in class SingleTypeReference
    • traverse

      public void traverse(ASTVisitor visitor, BlockScope scope)
      Description copied from class: Expression
      Traverse an expression in the context of a blockScope
      Overrides:
      traverse in class SingleTypeReference
    • traverse

      public void traverse(ASTVisitor visitor, ClassScope scope)
      Description copied from class: Expression
      Traverse an expression in the context of a classScope
      Overrides:
      traverse in class SingleTypeReference
    • internalResolveType

      protected TypeBinding internalResolveType(Scope scope, int location)
      Overrides:
      internalResolveType in class TypeReference
    • hasNullTypeAnnotation

      public boolean hasNullTypeAnnotation(TypeReference.AnnotationPosition position)
      Overrides:
      hasNullTypeAnnotation in class TypeReference