Alle implementierten Schnittstellen:
TypeConstants, TypeIds
Bekannte direkte Unterklassen:
IntersectionCastTypeReference, JavadocImplicitTypeReference, QualifiedTypeReference, SingleTypeReference, UnionTypeReference

public abstract class TypeReference extends Expression
  • Felddetails

    • NO_TYPE_ARGUMENTS

      public static final TypeReference[] NO_TYPE_ARGUMENTS
    • annotations

      public Annotation[][] annotations
  • Konstruktordetails

    • TypeReference

      public TypeReference()
  • Methodendetails

    • baseTypeReference

      public static final TypeReference baseTypeReference(int baseType, int dim, Annotation[][] dimAnnotations)
    • baseTypeReference

      public static final TypeReference baseTypeReference(int baseType, int dim)
    • aboutToResolve

      public void aboutToResolve(Scope scope)
    • analyseCode

      public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo)
      Setzt außer Kraft:
      analyseCode in Klasse Expression
    • checkBounds

      public void checkBounds(Scope scope)
    • augmentTypeWithAdditionalDimensions

      public abstract TypeReference augmentTypeWithAdditionalDimensions(int additionalDimensions, Annotation[][] additionalAnnotations, boolean isVarargs)
    • getMergedAnnotationsOnDimensions

      protected Annotation[][] getMergedAnnotationsOnDimensions(int additionalDimensions, Annotation[][] additionalAnnotations)
    • dimensions

      public int dimensions()
    • extraDimensions

      public int extraDimensions()
      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.
      Gibt zurück:
      int the extra dimension found
    • getAllAnnotationContexts

      public AnnotationContext[] getAllAnnotationContexts(int targetType)
    • getAllAnnotationContexts

      public void getAllAnnotationContexts(int targetType, int info, List<AnnotationContext> allAnnotationContexts)
      info can be either a type index (superclass/superinterfaces) or a pc into the bytecode
      Parameter:
      targetType -
      info -
      allAnnotationContexts -
    • getAllAnnotationContexts

      public void getAllAnnotationContexts(int targetType, int info, List<AnnotationContext> allAnnotationContexts, Annotation[] se7Annotations)
    • getAllAnnotationContexts

      public void getAllAnnotationContexts(int targetType, int info, List<AnnotationContext> allAnnotationContexts, Annotation[][] annotationsOnDimensions, int dimensions)
      info can be either a type index (superclass/superinterfaces) or a pc into the bytecode
    • getAllAnnotationContexts

      public void getAllAnnotationContexts(int targetType, int info, int typeIndex, List<AnnotationContext> allAnnotationContexts)
    • getAllAnnotationContexts

      public void getAllAnnotationContexts(int targetType, List<AnnotationContext> allAnnotationContexts)
    • getAnnotationsOnDimensions

      public Annotation[][] getAnnotationsOnDimensions()
    • getTypeArguments

      public TypeReference[][] getTypeArguments()
    • getAnnotationsOnDimensions

      public Annotation[][] getAnnotationsOnDimensions(boolean useSourceOrder)
      Parameter:
      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.
    • setAnnotationsOnDimensions

      public void setAnnotationsOnDimensions(Annotation[][] annotationsOnDimensions)
    • getLastToken

      public abstract char[] getLastToken()
    • getParameterizedTypeName

      public char[][] getParameterizedTypeName()
      Gibt zurück:
      char[][] TODO (jerome) should merge back into #getTypeName()
    • getTypeBindingPublic

      public TypeBinding getTypeBindingPublic(Scope scope)
    • getTypeBinding

      protected abstract TypeBinding getTypeBinding(Scope scope)
    • getTypeName

      public abstract char[][] getTypeName()
      Gibt zurück:
      char[][]
    • internalResolveType

      protected TypeBinding internalResolveType(Scope scope, int location)
    • isTypeReference

      public boolean isTypeReference()
      Setzt außer Kraft:
      isTypeReference in Klasse Expression
    • isWildcard

      public boolean isWildcard()
    • isUnionType

      public boolean isUnionType()
    • isVarargs

      public boolean isVarargs()
    • isParameterizedTypeReference

      public boolean isParameterizedTypeReference()
    • reportDeprecatedType

      protected void reportDeprecatedType(TypeBinding type, Scope scope, int index)
    • reportDeprecatedType

      protected void reportDeprecatedType(TypeBinding type, Scope scope)
    • reportInvalidType

      protected void reportInvalidType(Scope scope)
    • reportVarIsNotAllowedHere

      protected void reportVarIsNotAllowedHere(Scope scope)
    • resolveSuperType

      public TypeBinding resolveSuperType(ClassScope scope)
    • resolveType

      public final TypeBinding resolveType(BlockScope blockScope)
      Beschreibung aus Klasse kopiert: Expression
      Resolve the type of this expression in the context of a blockScope
      Setzt außer Kraft:
      resolveType in Klasse Expression
      Parameter:
      blockScope -
      Gibt zurück:
      Return the actual type of this expression after resolution
    • resolveType

      public TypeBinding resolveType(BlockScope scope, boolean checkBounds)
    • resolveType

      public TypeBinding resolveType(BlockScope scope, boolean checkBounds, int location)
    • resolveType

      public TypeBinding resolveType(ClassScope scope)
      Beschreibung aus Klasse kopiert: Expression
      Resolve the type of this expression in the context of a classScope
      Setzt außer Kraft:
      resolveType in Klasse Expression
      Parameter:
      scope -
      Gibt zurück:
      Return the actual type of this expression after resolution
    • resolveType

      public TypeBinding resolveType(ClassScope scope, int location)
    • resolveTypeArgument

      public TypeBinding resolveTypeArgument(BlockScope blockScope, ReferenceBinding genericType, int rank)
    • resolveTypeArgument

      public TypeBinding resolveTypeArgument(ClassScope classScope, ReferenceBinding genericType, int rank)
    • traverse

      public abstract void traverse(ASTVisitor visitor, BlockScope scope)
      Beschreibung aus Klasse kopiert: Expression
      Traverse an expression in the context of a blockScope
      Setzt außer Kraft:
      traverse in Klasse Expression
      Parameter:
      visitor -
      scope -
    • traverse

      public abstract void traverse(ASTVisitor visitor, ClassScope scope)
      Beschreibung aus Klasse kopiert: Expression
      Traverse an expression in the context of a classScope
      Setzt außer Kraft:
      traverse in Klasse Expression
      Parameter:
      visitor -
      scope -
    • updateWithAnnotations

      public void updateWithAnnotations(Scope scope, int location)
    • updateParameterizedTypeWithAnnotations

      protected TypeBinding updateParameterizedTypeWithAnnotations(Scope scope, TypeBinding type, TypeReference[] argRefs)
    • resolveAnnotations

      protected void resolveAnnotations(Scope scope, int location)
    • hasCompletedHierarchyCheckWithMembers

      protected static boolean hasCompletedHierarchyCheckWithMembers(TypeBinding type)
    • getTopAnnotations

      public Annotation[] getTopAnnotations()
    • getAnnotatableLevels

      public int getAnnotatableLevels()
    • checkIllegalNullAnnotations

      protected void checkIllegalNullAnnotations(Scope scope, TypeReference[] typeArguments)
      Check all typeArguments for illegal null annotations on base types.
    • checkNullConstraints

      protected void checkNullConstraints(Scope scope, Substitution substitution, TypeBinding[] variables, int rank)
      Check whether this type reference conforms to the null constraints defined for the corresponding type variable.
    • checkIllegalNullAnnotation

      protected void checkIllegalNullAnnotation(Scope scope)
    • findAnnotation

      public Annotation findAnnotation(long nullTagBits)
      Retrieve the null annotation that has been translated to the given nullTagBits.
    • hasNullTypeAnnotation

      public boolean hasNullTypeAnnotation(TypeReference.AnnotationPosition position)
    • containsNullAnnotation

      public static boolean containsNullAnnotation(Annotation[] annotations)
    • getTypeReferences

      public TypeReference[] getTypeReferences()
    • isBaseTypeReference

      public boolean isBaseTypeReference()
    • isTypeNameVar

      public boolean isTypeNameVar(Scope scope)
      Checks to see if the declaration uses 'var' as type name
      Parameter:
      scope - Relevant scope, for error reporting
      Gibt zurück:
      true, if source level is Java 10 or above and the type name is just 'var', false otherwise