Class TypeReferenceLocator

java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.search.matching.PatternLocator
org.aspectj.org.eclipse.jdt.internal.core.search.matching.TypeReferenceLocator
All Implemented Interfaces:
IQualifiedTypeResolutionListener, IIndexConstants

public class TypeReferenceLocator extends PatternLocator
  • Field Details

    • pattern

      protected final TypeReferencePattern pattern
    • isDeclarationOfReferencedTypesPattern

      protected final boolean isDeclarationOfReferencedTypesPattern
  • Constructor Details

  • Method Details

    • clear

      protected void clear()
      Overrides:
      clear in class PatternLocator
    • findElement

      protected IJavaElement findElement(IJavaElement element, int accuracy)
    • fineGrain

      protected int fineGrain()
      Overrides:
      fineGrain in class PatternLocator
    • match

      public int match(Annotation node, MatchingNodeSet nodeSet)
      Overrides:
      match in class PatternLocator
    • match

      public int match(ASTNode node, MatchingNodeSet nodeSet)
      Description copied from class: PatternLocator
      Check if the given ast node syntactically matches this pattern. If it does, add it to the match set. Returns the match level.
      Overrides:
      match in class PatternLocator
    • match

      public int match(Reference node, MatchingNodeSet nodeSet)
      Overrides:
      match in class PatternLocator
    • match

      public int match(TypeReference node, MatchingNodeSet nodeSet)
      Overrides:
      match in class PatternLocator
    • matchLevel

      protected int matchLevel(ImportReference importRef)
      Description copied from class: PatternLocator
      Returns the match level for the given importRef.
      Overrides:
      matchLevel in class PatternLocator
    • matchLevelAndReportImportRef

      protected void matchLevelAndReportImportRef(ImportReference importRef, Binding binding, MatchLocator locator) throws org.eclipse.core.runtime.CoreException
      Description copied from class: PatternLocator
      Reports the match of the given import reference if the resolveLevel is high enough.
      Overrides:
      matchLevelAndReportImportRef in class PatternLocator
      Throws:
      org.eclipse.core.runtime.CoreException
    • matchReportImportRef

      protected void matchReportImportRef(ImportReference importRef, Binding binding, IJavaElement element, int accuracy, MatchLocator locator) throws org.eclipse.core.runtime.CoreException
      Description copied from class: PatternLocator
      Reports the match of the given import reference.
      Overrides:
      matchReportImportRef in class PatternLocator
      Throws:
      org.eclipse.core.runtime.CoreException
    • matchReportReference

      protected void matchReportReference(ArrayTypeReference arrayRef, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws org.eclipse.core.runtime.CoreException
      Throws:
      org.eclipse.core.runtime.CoreException
    • matchReportReference

      protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws org.eclipse.core.runtime.CoreException
      Reports the match of the given reference.
      Overrides:
      matchReportReference in class PatternLocator
      Throws:
      org.eclipse.core.runtime.CoreException
    • matchReportReference

      protected void matchReportReference(ASTNode reference, IJavaElement element, IJavaElement localElement, IJavaElement[] otherElements, Binding elementBinding, int accuracy, MatchLocator locator) throws org.eclipse.core.runtime.CoreException
      Reports the match of the given reference. Also provide a local and other elements to eventually report in match.
      Overrides:
      matchReportReference in class PatternLocator
      Throws:
      org.eclipse.core.runtime.CoreException
    • matchReportReference

      protected void matchReportReference(QualifiedNameReference qNameRef, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws org.eclipse.core.runtime.CoreException
      Throws:
      org.eclipse.core.runtime.CoreException
    • matchReportReference

      protected void matchReportReference(QualifiedTypeReference qTypeRef, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws org.eclipse.core.runtime.CoreException
      Throws:
      org.eclipse.core.runtime.CoreException
    • referenceType

      protected int referenceType()
      Overrides:
      referenceType in class PatternLocator
    • reportDeclaration

      protected void reportDeclaration(ASTNode reference, IJavaElement element, MatchLocator locator, SimpleSet knownTypes) throws org.eclipse.core.runtime.CoreException
      Throws:
      org.eclipse.core.runtime.CoreException
    • reportDeclaration

      protected void reportDeclaration(ReferenceBinding typeBinding, int maxType, MatchLocator locator, SimpleSet knownTypes) throws org.eclipse.core.runtime.CoreException
      Throws:
      org.eclipse.core.runtime.CoreException
    • resolveLevel

      public int resolveLevel(ASTNode node)
      Description copied from class: PatternLocator
      Finds out whether the given ast node matches this search pattern. Returns IMPOSSIBLE_MATCH if it doesn't. Returns INACCURATE_MATCH if it potentially matches this search pattern (i.e. it has already been resolved but resolving failed.) Returns ACCURATE_MATCH if it matches exactly this search pattern (i.e. it doesn't need to be resolved or it has already been resolved.)
      Overrides:
      resolveLevel in class PatternLocator
    • resolveLevel

      public int resolveLevel(Binding binding)
      Description copied from class: PatternLocator
      Finds out whether the given binding matches this search pattern. Returns ACCURATE_MATCH if it does. Returns INACCURATE_MATCH if resolve failed but match is still possible. Returns IMPOSSIBLE_MATCH otherwise. Default is to return INACCURATE_MATCH.
      Overrides:
      resolveLevel in class PatternLocator
    • resolveLevel

      protected int resolveLevel(NameReference nameRef)
    • resolveLevel

      protected int resolveLevel(TypeReference typeRef)
    • resolveLevelForType

      protected int resolveLevelForType(TypeBinding typeBinding)
    • resolveLevelForTypeOrEnclosingTypes

      protected int resolveLevelForTypeOrEnclosingTypes(char[] simpleNamePattern, char[] qualificationPattern, TypeBinding binding)
      Returns whether the given type binding or one of its enclosing types matches the given simple name pattern and qualification pattern. Returns ACCURATE_MATCH if it does. Returns INACCURATE_MATCH if resolve failed. Returns IMPOSSIBLE_MATCH if it doesn't.
    • recordResolution

      public void recordResolution(QualifiedTypeReference typeReference, TypeBinding resolution)
      Description copied from interface: IQualifiedTypeResolutionListener
      Notifies that the given resolution has been found for the given type reference. Some of the bindings are intermediate types i.e. qualifying types.
      Specified by:
      recordResolution in interface IQualifiedTypeResolutionListener
      Overrides:
      recordResolution in class PatternLocator
      Parameters:
      typeReference - the type reference
      resolution - the resolution found
    • toString

      public String toString()
      Overrides:
      toString in class PatternLocator