org.aspectj.org.eclipse.jdt.internal.core.search.matching
Class TypeReferenceLocator

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

public class TypeReferenceLocator
extends PatternLocator


Field Summary
protected  boolean isDeclarationOfReferencedTypesPattern
           
protected  TypeReferencePattern pattern
           
 
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.search.matching.PatternLocator
ACCURATE_MATCH, ALL_CONTAINER, CAMELCASE_FLAVOR, CLASS_CONTAINER, COMPILATION_UNIT_CONTAINER, ERASURE_MATCH, EXACT_FLAVOR, FIELD_CONTAINER, FLAVORS_MASK, IMPOSSIBLE_MATCH, INACCURATE_MATCH, isCaseSensitive, isEquivalentMatch, isErasureMatch, MATCH_LEVEL_MASK, matchMode, mayBeGeneric, METHOD_CONTAINER, mustResolve, NO_FLAVOR, OVERRIDDEN_METHOD_FLAVOR, PATTERN_FLAVOR, POSSIBLE_MATCH, PREFIX_FLAVOR, RAW_MASK, REGEXP_FLAVOR, RULE_MASK, SUB_INVOCATION_FLAVOR, SUPER_INVOCATION_FLAVOR, SUPERTYPE_REF_FLAVOR
 
Fields inherited from interface org.aspectj.org.eclipse.jdt.internal.core.search.indexing.IIndexConstants
AND_PATTERN, ANNOT_REF_PATTERN, ANNOTATION_REF, ANNOTATION_TYPE_SUFFIX, CLASS_AND_ENUM_SUFFIX, CLASS_AND_INTERFACE_SUFFIX, CLASS_SUFFIX, CONSTRUCTOR_DECL, CONSTRUCTOR_PATTERN, CONSTRUCTOR_REF, COUNTS, DEFAULT_CONSTRUCTOR, ENUM_SUFFIX, FIELD_DECL, FIELD_PATTERN, INTERFACE_AND_ANNOTATION_SUFFIX, INTERFACE_SUFFIX, LOCAL_VAR_PATTERN, METHOD_DECL, METHOD_PATTERN, METHOD_REF, OBJECT, ONE_STAR, ONE_STAR_CHAR, ONE_ZERO, ONE_ZERO_CHAR, OR_PATTERN, PARAMETER_SEPARATOR, PKG_DECL_PATTERN, PKG_REF_PATTERN, REF, SECONDARY_SUFFIX, SEPARATOR, SUPER_REF, SUPER_REF_PATTERN, TYPE_DECL, TYPE_DECL_PATTERN, TYPE_PARAM_PATTERN, TYPE_REF_PATTERN, TYPE_SUFFIX, ZERO_CHAR
 
Constructor Summary
TypeReferenceLocator(TypeReferencePattern pattern)
           
 
Method Summary
protected  IJavaElement findElement(IJavaElement element, int accuracy)
           
protected  int fineGrain()
           
 int match(Annotation node, MatchingNodeSet nodeSet)
           
 int match(ASTNode node, MatchingNodeSet nodeSet)
          Check if the given ast node syntactically matches this pattern.
 int match(Reference node, MatchingNodeSet nodeSet)
           
 int match(TypeReference node, MatchingNodeSet nodeSet)
           
protected  int matchLevel(ImportReference importRef)
          Returns the match level for the given importRef.
protected  void matchLevelAndReportImportRef(ImportReference importRef, Binding binding, MatchLocator locator)
          Reports the match of the given import reference if the resolveLevel is high enough.
protected  void matchReportImportRef(ImportReference importRef, Binding binding, IJavaElement element, int accuracy, MatchLocator locator)
          Reports the match of the given import reference.
protected  void matchReportReference(ArrayTypeReference arrayRef, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator)
           
protected  void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator)
          Reports the match of the given reference.
protected  void matchReportReference(ASTNode reference, IJavaElement element, IJavaElement localElement, IJavaElement[] otherElements, Binding elementBinding, int accuracy, MatchLocator locator)
          Reports the match of the given reference.
protected  void matchReportReference(QualifiedNameReference qNameRef, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator)
           
protected  void matchReportReference(QualifiedTypeReference qTypeRef, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator)
           
protected  int referenceType()
           
protected  void reportDeclaration(ASTNode reference, IJavaElement element, MatchLocator locator, SimpleSet knownTypes)
           
protected  void reportDeclaration(ReferenceBinding typeBinding, int maxType, MatchLocator locator, SimpleSet knownTypes)
           
 int resolveLevel(ASTNode node)
          Finds out whether the given ast node matches this search pattern.
 int resolveLevel(Binding binding)
          Finds out whether the given binding matches this search pattern.
protected  int resolveLevel(NameReference nameRef)
           
protected  int resolveLevel(TypeReference typeRef)
           
protected  int resolveLevelForType(TypeBinding typeBinding)
           
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.
 java.lang.String toString()
           
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.search.matching.PatternLocator
clear, getQualifiedPattern, getQualifiedSourceName, getTypeNameBinding, initializePolymorphicSearch, match, match, match, match, match, match, match, match, match, matchContainer, matchesName, matchesTypeReference, matchNameValue, newDeclarationMatch, patternLocator, qualifiedPattern, qualifiedSourceName, resolveLevelForType, resolveLevelForType, resolveLevelForType, updateMatch, updateMatch, updateMatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pattern

protected TypeReferencePattern pattern

isDeclarationOfReferencedTypesPattern

protected boolean isDeclarationOfReferencedTypesPattern
Constructor Detail

TypeReferenceLocator

public TypeReferenceLocator(TypeReferencePattern pattern)
Method Detail

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 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:
CoreException

matchReportImportRef

protected void matchReportImportRef(ImportReference importRef,
                                    Binding binding,
                                    IJavaElement element,
                                    int accuracy,
                                    MatchLocator locator)
                             throws CoreException
Description copied from class: PatternLocator
Reports the match of the given import reference.

Overrides:
matchReportImportRef in class PatternLocator
Throws:
CoreException

matchReportReference

protected void matchReportReference(ArrayTypeReference arrayRef,
                                    IJavaElement element,
                                    Binding elementBinding,
                                    int accuracy,
                                    MatchLocator locator)
                             throws CoreException
Throws:
CoreException

matchReportReference

protected void matchReportReference(ASTNode reference,
                                    IJavaElement element,
                                    Binding elementBinding,
                                    int accuracy,
                                    MatchLocator locator)
                             throws CoreException
Reports the match of the given reference.

Overrides:
matchReportReference in class PatternLocator
Throws:
CoreException

matchReportReference

protected void matchReportReference(ASTNode reference,
                                    IJavaElement element,
                                    IJavaElement localElement,
                                    IJavaElement[] otherElements,
                                    Binding elementBinding,
                                    int accuracy,
                                    MatchLocator locator)
                             throws 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:
CoreException

matchReportReference

protected void matchReportReference(QualifiedNameReference qNameRef,
                                    IJavaElement element,
                                    Binding elementBinding,
                                    int accuracy,
                                    MatchLocator locator)
                             throws CoreException
Throws:
CoreException

matchReportReference

protected void matchReportReference(QualifiedTypeReference qTypeRef,
                                    IJavaElement element,
                                    Binding elementBinding,
                                    int accuracy,
                                    MatchLocator locator)
                             throws CoreException
Throws:
CoreException

referenceType

protected int referenceType()
Overrides:
referenceType in class PatternLocator

reportDeclaration

protected void reportDeclaration(ASTNode reference,
                                 IJavaElement element,
                                 MatchLocator locator,
                                 SimpleSet knownTypes)
                          throws CoreException
Throws:
CoreException

reportDeclaration

protected void reportDeclaration(ReferenceBinding typeBinding,
                                 int maxType,
                                 MatchLocator locator,
                                 SimpleSet knownTypes)
                          throws CoreException
Throws:
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.


toString

public java.lang.String toString()
Overrides:
toString in class PatternLocator