Class StubBinding

java.lang.Object
fr.inria.verveine.extractor.java.utils.StubBinding
All Implemented Interfaces:
org.eclipse.jdt.core.dom.IBinding, org.eclipse.jdt.core.dom.IMethodBinding, org.eclipse.jdt.core.dom.ITypeBinding

public class StubBinding extends Object implements org.eclipse.jdt.core.dom.ITypeBinding, org.eclipse.jdt.core.dom.IMethodBinding
This is an IBinding implementor to serve as key for unresolved entities.

The Famix dictionary needs an IBinding as entity key. But some entities not fully resolved (eg a class inheriting from an unknown superclass) don't have binding even though we have their declaration. So we create this class that will implement a fake IBinding for such cases.

Only used for entities that may contain other entities (ie types and methods)

  • Field Details

    • UNKNOWN_KIND

      public static final int UNKNOWN_KIND
      See Also:
    • instances

      protected static Map<String, StubBinding> instances
      A map of key/instances to make sure the same StubBinding instance is always associated to a given node
  • Method Details

    • getDeclarationBinding

      public static org.eclipse.jdt.core.dom.IBinding getDeclarationBinding(org.eclipse.jdt.core.dom.AbstractTypeDeclaration node)
      returns the real binding of the node (a method or type declaration) or creates a stub one
    • getDeclarationBinding

      public static org.eclipse.jdt.core.dom.IBinding getDeclarationBinding(org.eclipse.jdt.core.dom.AnonymousClassDeclaration node)
    • getDeclarationBinding

      public static org.eclipse.jdt.core.dom.IBinding getDeclarationBinding(org.eclipse.jdt.core.dom.MethodDeclaration node)
    • getBinding

      public static StubBinding getBinding(org.eclipse.jdt.core.dom.ASTNode node)
      returns the StubBinding of the node (a method or type declaration)
    • getAnnotations

      public org.eclipse.jdt.core.dom.IAnnotationBinding[] getAnnotations()
      Specified by:
      getAnnotations in interface org.eclipse.jdt.core.dom.IBinding
    • getKind

      public int getKind()
      Specified by:
      getKind in interface org.eclipse.jdt.core.dom.IBinding
    • getName

      public String getName()
      Specified by:
      getName in interface org.eclipse.jdt.core.dom.IBinding
      Specified by:
      getName in interface org.eclipse.jdt.core.dom.IMethodBinding
      Specified by:
      getName in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getModifiers

      public int getModifiers()
      Specified by:
      getModifiers in interface org.eclipse.jdt.core.dom.IBinding
      Specified by:
      getModifiers in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isDeprecated

      public boolean isDeprecated()
      Specified by:
      isDeprecated in interface org.eclipse.jdt.core.dom.IBinding
    • isRecovered

      public boolean isRecovered()
      Specified by:
      isRecovered in interface org.eclipse.jdt.core.dom.IBinding
    • isSynthetic

      public boolean isSynthetic()
      Specified by:
      isSynthetic in interface org.eclipse.jdt.core.dom.IBinding
    • getJavaElement

      public org.eclipse.jdt.core.IJavaElement getJavaElement()
      Specified by:
      getJavaElement in interface org.eclipse.jdt.core.dom.IBinding
    • getKey

      public String getKey()
      Specified by:
      getKey in interface org.eclipse.jdt.core.dom.IBinding
    • isEqualTo

      public boolean isEqualTo(org.eclipse.jdt.core.dom.IBinding that)
      Specified by:
      isEqualTo in interface org.eclipse.jdt.core.dom.IBinding
    • isRecord

      public boolean isRecord()
      Specified by:
      isRecord in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getPackage

      public org.eclipse.jdt.core.dom.IPackageBinding getPackage()
      Specified by:
      getPackage in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getQualifiedName

      public String getQualifiedName()
      Specified by:
      getQualifiedName in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getSuperclass

      public org.eclipse.jdt.core.dom.ITypeBinding getSuperclass()
      Specified by:
      getSuperclass in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getTypeAnnotations

      public org.eclipse.jdt.core.dom.IAnnotationBinding[] getTypeAnnotations()
      Specified by:
      getTypeAnnotations in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getTypeArguments

      public org.eclipse.jdt.core.dom.ITypeBinding[] getTypeArguments()
      Specified by:
      getTypeArguments in interface org.eclipse.jdt.core.dom.IMethodBinding
      Specified by:
      getTypeArguments in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getTypeBounds

      public org.eclipse.jdt.core.dom.ITypeBinding[] getTypeBounds()
      Specified by:
      getTypeBounds in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getTypeDeclaration

      public org.eclipse.jdt.core.dom.ITypeBinding getTypeDeclaration()
      Specified by:
      getTypeDeclaration in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getTypeParameters

      public org.eclipse.jdt.core.dom.ITypeBinding[] getTypeParameters()
      Specified by:
      getTypeParameters in interface org.eclipse.jdt.core.dom.IMethodBinding
      Specified by:
      getTypeParameters in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getWildcard

      public org.eclipse.jdt.core.dom.ITypeBinding getWildcard()
      Specified by:
      getWildcard in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isAnnotation

      public boolean isAnnotation()
      Specified by:
      isAnnotation in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isAnonymous

      public boolean isAnonymous()
      Specified by:
      isAnonymous in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isArray

      public boolean isArray()
      Specified by:
      isArray in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isAssignmentCompatible

      public boolean isAssignmentCompatible(org.eclipse.jdt.core.dom.ITypeBinding iTypeBinding)
      Specified by:
      isAssignmentCompatible in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isCapture

      public boolean isCapture()
      Specified by:
      isCapture in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isCastCompatible

      public boolean isCastCompatible(org.eclipse.jdt.core.dom.ITypeBinding iTypeBinding)
      Specified by:
      isCastCompatible in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isClass

      public boolean isClass()
      Specified by:
      isClass in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isEnum

      public boolean isEnum()
      Specified by:
      isEnum in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isFromSource

      public boolean isFromSource()
      Specified by:
      isFromSource in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isGenericType

      public boolean isGenericType()
      Specified by:
      isGenericType in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isInterface

      public boolean isInterface()
      Specified by:
      isInterface in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isIntersectionType

      public boolean isIntersectionType()
      Specified by:
      isIntersectionType in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isLocal

      public boolean isLocal()
      Specified by:
      isLocal in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isMember

      public boolean isMember()
      Specified by:
      isMember in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isNested

      public boolean isNested()
      Specified by:
      isNested in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isNullType

      public boolean isNullType()
      Specified by:
      isNullType in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isParameterizedType

      public boolean isParameterizedType()
      Specified by:
      isParameterizedType in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isPrimitive

      public boolean isPrimitive()
      Specified by:
      isPrimitive in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isRawType

      public boolean isRawType()
      Specified by:
      isRawType in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isSubTypeCompatible

      public boolean isSubTypeCompatible(org.eclipse.jdt.core.dom.ITypeBinding iTypeBinding)
      Specified by:
      isSubTypeCompatible in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isTopLevel

      public boolean isTopLevel()
      Specified by:
      isTopLevel in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isTypeVariable

      public boolean isTypeVariable()
      Specified by:
      isTypeVariable in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isUpperbound

      public boolean isUpperbound()
      Specified by:
      isUpperbound in interface org.eclipse.jdt.core.dom.ITypeBinding
    • isWildcardType

      public boolean isWildcardType()
      Specified by:
      isWildcardType in interface org.eclipse.jdt.core.dom.ITypeBinding
    • createArrayType

      public org.eclipse.jdt.core.dom.ITypeBinding createArrayType(int i)
      Specified by:
      createArrayType in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getBinaryName

      public String getBinaryName()
      Specified by:
      getBinaryName in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getBound

      public org.eclipse.jdt.core.dom.ITypeBinding getBound()
      Specified by:
      getBound in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getGenericTypeOfWildcardType

      public org.eclipse.jdt.core.dom.ITypeBinding getGenericTypeOfWildcardType()
      Specified by:
      getGenericTypeOfWildcardType in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getRank

      public int getRank()
      Specified by:
      getRank in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getComponentType

      public org.eclipse.jdt.core.dom.ITypeBinding getComponentType()
      Specified by:
      getComponentType in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getDeclaredFields

      public org.eclipse.jdt.core.dom.IVariableBinding[] getDeclaredFields()
      Specified by:
      getDeclaredFields in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getDeclaredMethods

      public org.eclipse.jdt.core.dom.IMethodBinding[] getDeclaredMethods()
      Specified by:
      getDeclaredMethods in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getDeclaredModifiers

      public int getDeclaredModifiers()
      Specified by:
      getDeclaredModifiers in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getDeclaredTypes

      public org.eclipse.jdt.core.dom.ITypeBinding[] getDeclaredTypes()
      Specified by:
      getDeclaredTypes in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getDeclaringClass

      public org.eclipse.jdt.core.dom.ITypeBinding getDeclaringClass()
      Specified by:
      getDeclaringClass in interface org.eclipse.jdt.core.dom.IMethodBinding
      Specified by:
      getDeclaringClass in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getDeclaringMethod

      public org.eclipse.jdt.core.dom.IMethodBinding getDeclaringMethod()
      Specified by:
      getDeclaringMethod in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getDeclaringMember

      public org.eclipse.jdt.core.dom.IBinding getDeclaringMember()
      Specified by:
      getDeclaringMember in interface org.eclipse.jdt.core.dom.IMethodBinding
      Specified by:
      getDeclaringMember in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getDimensions

      public int getDimensions()
      Specified by:
      getDimensions in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getElementType

      public org.eclipse.jdt.core.dom.ITypeBinding getElementType()
      Specified by:
      getElementType in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getErasure

      public org.eclipse.jdt.core.dom.ITypeBinding getErasure()
      Specified by:
      getErasure in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getFunctionalInterfaceMethod

      public org.eclipse.jdt.core.dom.IMethodBinding getFunctionalInterfaceMethod()
      Specified by:
      getFunctionalInterfaceMethod in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getInterfaces

      public org.eclipse.jdt.core.dom.ITypeBinding[] getInterfaces()
      Specified by:
      getInterfaces in interface org.eclipse.jdt.core.dom.ITypeBinding
    • getParameterNames

      public String[] getParameterNames()
      Specified by:
      getParameterNames in interface org.eclipse.jdt.core.dom.IMethodBinding
    • isSyntheticRecordMethod

      public boolean isSyntheticRecordMethod()
      Specified by:
      isSyntheticRecordMethod in interface org.eclipse.jdt.core.dom.IMethodBinding
    • getSyntheticOuterLocals

      public org.eclipse.jdt.core.dom.IVariableBinding[] getSyntheticOuterLocals()
      Specified by:
      getSyntheticOuterLocals in interface org.eclipse.jdt.core.dom.IMethodBinding
    • isCanonicalConstructor

      public boolean isCanonicalConstructor()
      Specified by:
      isCanonicalConstructor in interface org.eclipse.jdt.core.dom.IMethodBinding
    • isCompactConstructor

      public boolean isCompactConstructor()
      Specified by:
      isCompactConstructor in interface org.eclipse.jdt.core.dom.IMethodBinding
    • isConstructor

      public boolean isConstructor()
      Specified by:
      isConstructor in interface org.eclipse.jdt.core.dom.IMethodBinding
    • isDefaultConstructor

      public boolean isDefaultConstructor()
      Specified by:
      isDefaultConstructor in interface org.eclipse.jdt.core.dom.IMethodBinding
    • getMethodDeclaration

      public org.eclipse.jdt.core.dom.IMethodBinding getMethodDeclaration()
      Specified by:
      getMethodDeclaration in interface org.eclipse.jdt.core.dom.IMethodBinding
    • isRawMethod

      public boolean isRawMethod()
      Specified by:
      isRawMethod in interface org.eclipse.jdt.core.dom.IMethodBinding
    • isSubsignature

      public boolean isSubsignature(org.eclipse.jdt.core.dom.IMethodBinding iMethodBinding)
      Specified by:
      isSubsignature in interface org.eclipse.jdt.core.dom.IMethodBinding
    • isVarargs

      public boolean isVarargs()
      Specified by:
      isVarargs in interface org.eclipse.jdt.core.dom.IMethodBinding
    • overrides

      public boolean overrides(org.eclipse.jdt.core.dom.IMethodBinding iMethodBinding)
      Specified by:
      overrides in interface org.eclipse.jdt.core.dom.IMethodBinding
    • isAnnotationMember

      public boolean isAnnotationMember()
      Specified by:
      isAnnotationMember in interface org.eclipse.jdt.core.dom.IMethodBinding
    • isGenericMethod

      public boolean isGenericMethod()
      Specified by:
      isGenericMethod in interface org.eclipse.jdt.core.dom.IMethodBinding
    • isParameterizedMethod

      public boolean isParameterizedMethod()
      Specified by:
      isParameterizedMethod in interface org.eclipse.jdt.core.dom.IMethodBinding
    • getDefaultValue

      public Object getDefaultValue()
      Specified by:
      getDefaultValue in interface org.eclipse.jdt.core.dom.IMethodBinding
    • getParameterAnnotations

      public org.eclipse.jdt.core.dom.IAnnotationBinding[] getParameterAnnotations(int i)
      Specified by:
      getParameterAnnotations in interface org.eclipse.jdt.core.dom.IMethodBinding
    • getParameterTypes

      public org.eclipse.jdt.core.dom.ITypeBinding[] getParameterTypes()
      Specified by:
      getParameterTypes in interface org.eclipse.jdt.core.dom.IMethodBinding
    • getDeclaredReceiverType

      public org.eclipse.jdt.core.dom.ITypeBinding getDeclaredReceiverType()
      Specified by:
      getDeclaredReceiverType in interface org.eclipse.jdt.core.dom.IMethodBinding
    • getReturnType

      public org.eclipse.jdt.core.dom.ITypeBinding getReturnType()
      Specified by:
      getReturnType in interface org.eclipse.jdt.core.dom.IMethodBinding
    • getExceptionTypes

      public org.eclipse.jdt.core.dom.ITypeBinding[] getExceptionTypes()
      Specified by:
      getExceptionTypes in interface org.eclipse.jdt.core.dom.IMethodBinding