Class MethodLocator
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.search.matching.PatternLocator
org.aspectj.org.eclipse.jdt.internal.core.search.matching.MethodLocator
- All Implemented Interfaces:
IQualifiedTypeResolutionListener, IIndexConstants
-
Field Summary
FieldsModifier and TypeFieldDescriptionchar[][][]protected booleanprotected MatchLocatorprotected MethodPatternFields inherited from class 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_FLAVORModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intprotected booleanprotected booleanprotected booleanstatic final intprotected intprotected booleanstatic final intprotected booleanstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from interface 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, META_INDEX_CATEGORIES, META_INDEX_QUALIFIED_SUPER_TYPE_QUALIFIER_REF, META_INDEX_QUALIFIED_TYPE_QUALIFIER_REF, META_INDEX_SIMPLE_SUPER_TYPE_QUALIFIER_REF, META_INDEX_SIMPLE_TYPE_QUALIFIER_REF, METHOD_DECL, METHOD_DECL_PLUS, METHOD_PATTERN, METHOD_REF, MODULE_DECL, MODULE_INFO, MODULE_PATTERN, MODULE_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_CHARModifier and TypeFieldDescriptionstatic final intstatic final intstatic final char[]static final charstatic final charstatic final charstatic final charstatic final char[]static final intstatic final char[]static final char[][]/$NON-NLS-1$static final char[]static final charstatic final char[]static final intstatic final charstatic final charstatic final intstatic final char[][]static final char[]static final char[]static final char[]static final char[]static final char[]static final char[]static final intstatic final char[]static final char[]static final char[]static final intstatic final char[]static final char[]static final char[]static final char[][]static final char[]static final char[][]static final intstatic final charstatic final intstatic final intstatic final char[]static final charstatic final charstatic final char[]static final intstatic final char[]static final intstatic final intstatic final intstatic final charstatic final char -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ReferenceBindingcheckMethodRef(MethodBinding method, ReferenceExpression referenceExpression) protected voidclear()protected intvoidinitializePolymorphicSearch(MatchLocator locator) Initializes this search pattern so that polymorphic search can be performed.protected booleanisVirtualInvoke(MethodBinding method, MessageSend messageSend) Returns whether the code gen will use an invoke virtual for this message send or not.intmatch(Annotation node, MatchingNodeSet nodeSet) intmatch(ASTNode node, MatchingNodeSet nodeSet) Check if the given ast node syntactically matches this pattern.intmatch(LambdaExpression node, MatchingNodeSet nodeSet) intmatch(MemberValuePair node, MatchingNodeSet nodeSet) intmatch(MessageSend node, MatchingNodeSet nodeSet) intmatch(MethodDeclaration node, MatchingNodeSet nodeSet) intmatch(ReferenceExpression node, MatchingNodeSet nodeSet) protected intReturns the type(s) of container for this pattern.protected voidmatchLevelAndReportImportRef(ImportReference importRef, Binding binding, MatchLocator locator) Reports the match of the given import reference if the resolveLevel is high enough.protected intmatchMethod(MethodBinding method, boolean skipImpossibleArg) protected voidmatchReportReference(ASTNode reference, IJavaElement element, IJavaElement localElement, IJavaElement[] otherElements, Binding elementBinding, int accuracy, MatchLocator locator) Reports the match of the given reference.protected voidmatchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) Reports the match of the given reference.newDeclarationMatch(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, int length, MatchLocator locator) protected intprotected voidreportDeclaration(MethodBinding methodBinding, MatchLocator locator, SimpleSet knownMethods) intresolveLevel(ASTNode possibleMatchingNode) Finds out whether the given ast node matches this search pattern.protected intresolveLevel(MessageSend messageSend) protected intresolveLevel(ReferenceExpression referenceExpression) intresolveLevel(Binding binding) Finds out whether the given binding matches this search pattern.protected intresolveLevelAsSubtype(char[] simplePattern, char[] qualifiedPattern, ReferenceBinding type, char[] methodName, TypeBinding[] argumentTypes, char[] packageName, boolean isDefault) Returns whether the given reference type binding matches or is a subtype of a type that matches the given qualified pattern.toString()Methods inherited from class PatternLocator
getMatchMode, getQualifiedPattern, getQualifiedSourceName, getTypeNameBinding, isCaseSensitive, isEquivalentMatch, isErasureMatch, isMayBeGeneric, isMustResolve, match, match, match, match, match, match, match, match, match, match, matchesName, matchesTypeReference, matchLevel, matchNameValue, matchReportImportRef, patternLocator, qualifiedPattern, qualifiedSourceName, recordResolution, resolveLevelForType, resolveLevelForType, resolveLevelForType, updateMatch, updateMatch, updateMatchModifier and TypeMethodDescriptionintprotected char[]getQualifiedPattern(char[] simpleNamePattern, char[] qualificationPattern) protected char[]getQualifiedSourceName(TypeBinding binding) protected TypeBindinggetTypeNameBinding(int index) booleanbooleanbooleanbooleanbooleanintmatch(ConstructorDeclaration node, MatchingNodeSet nodeSet) intmatch(Expression node, MatchingNodeSet nodeSet) intmatch(FieldDeclaration node, MatchingNodeSet nodeSet) intmatch(LocalDeclaration node, MatchingNodeSet nodeSet) protected intmatch(ModuleDeclaration node, MatchingNodeSet nodeSet) protected intmatch(ModuleReference node, MatchingNodeSet nodeSet) intmatch(Reference node, MatchingNodeSet nodeSet) intmatch(TypeDeclaration node, MatchingNodeSet nodeSet) intmatch(TypeParameter node, MatchingNodeSet nodeSet) intmatch(TypeReference node, MatchingNodeSet nodeSet) protected booleanmatchesName(char[] pattern, char[] name) Returns whether the given name matches the given pattern.protected booleanmatchesTypeReference(char[] pattern, TypeReference type) Returns whether the given type reference matches the given pattern.protected intmatchLevel(ImportReference importRef) Returns the match level for the given importRef.protected intmatchNameValue(char[] pattern, char[] name) Return how the given name matches the given pattern.protected voidmatchReportImportRef(ImportReference importRef, Binding binding, IJavaElement element, int accuracy, MatchLocator locator) Reports the match of the given import reference.static PatternLocatorpatternLocator(SearchPattern pattern) static char[]qualifiedPattern(char[] simpleNamePattern, char[] qualificationPattern) static char[]qualifiedSourceName(TypeBinding binding) voidrecordResolution(QualifiedTypeReference typeReference, TypeBinding resolution) Notifies that the given resolution has been found for the given type reference.protected intresolveLevelForType(char[] simpleNamePattern, char[] qualificationPattern, char[][][] patternTypeArguments, int depth, TypeBinding type) protected intresolveLevelForType(char[] simpleNamePattern, char[] qualificationPattern, TypeBinding binding) Returns whether the given type binding matches the given simple name pattern and qualification pattern.protected intresolveLevelForType(char[] qualifiedPattern, TypeBinding type) Returns whether the given type binding matches the given qualified pattern.protected voidupdateMatch(ParameterizedTypeBinding parameterizedBinding, char[][][] patternTypeArguments, boolean patternHasTypeParameters, int depth, MatchLocator locator) protected voidupdateMatch(ParameterizedTypeBinding parameterizedBinding, char[][][] patternTypeArguments, MatchLocator locator) protected voidupdateMatch(TypeBinding[] argumentsBinding, MatchLocator locator, char[][] patternArguments, boolean hasTypeParameters)
-
Field Details
-
pattern
-
isDeclarationOfReferencedMethodsPattern
protected boolean isDeclarationOfReferencedMethodsPattern -
allSuperDeclaringTypeNames
public char[][][] allSuperDeclaringTypeNames -
matchLocator
-
-
Constructor Details
-
MethodLocator
-
-
Method Details
-
clear
protected void clear()- Overrides:
clearin classPatternLocator
-
fineGrain
protected int fineGrain()- Overrides:
fineGrainin classPatternLocator
-
initializePolymorphicSearch
Description copied from class:PatternLocatorInitializes this search pattern so that polymorphic search can be performed.- Overrides:
initializePolymorphicSearchin classPatternLocator
-
isVirtualInvoke
Returns whether the code gen will use an invoke virtual for this message send or not. -
checkMethodRef
protected ReferenceBinding checkMethodRef(MethodBinding method, ReferenceExpression referenceExpression) -
match
Description copied from class:PatternLocatorCheck if the given ast node syntactically matches this pattern. If it does, add it to the match set. Returns the match level.- Overrides:
matchin classPatternLocator
-
match
- Overrides:
matchin classPatternLocator
-
match
- Overrides:
matchin classPatternLocator
-
match
- Overrides:
matchin classPatternLocator
-
match
- Overrides:
matchin classPatternLocator
-
match
- Overrides:
matchin classPatternLocator
-
match
- Overrides:
matchin classPatternLocator
-
matchContainer
protected int matchContainer()Description copied from class:PatternLocatorReturns the type(s) of container for this pattern. It is a bit combination of types, denoting compilation unit, class declarations, field declarations or method declarations.- Overrides:
matchContainerin classPatternLocator
-
matchLevelAndReportImportRef
protected void matchLevelAndReportImportRef(ImportReference importRef, Binding binding, MatchLocator locator) throws org.eclipse.core.runtime.CoreException Description copied from class:PatternLocatorReports the match of the given import reference if the resolveLevel is high enough.- Overrides:
matchLevelAndReportImportRefin classPatternLocator- Throws:
org.eclipse.core.runtime.CoreException
-
matchMethod
-
matchReportReference
protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws org.eclipse.core.runtime.CoreException Description copied from class:PatternLocatorReports the match of the given reference.- Overrides:
matchReportReferencein classPatternLocator- 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 Description copied from class:PatternLocatorReports the match of the given reference. Also provide a local element to eventually report in match.- Overrides:
matchReportReferencein classPatternLocator- Throws:
org.eclipse.core.runtime.CoreException- See Also:
-
newDeclarationMatch
public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, int length, MatchLocator locator) - Overrides:
newDeclarationMatchin classPatternLocator
-
referenceType
protected int referenceType()- Overrides:
referenceTypein classPatternLocator
-
reportDeclaration
protected void reportDeclaration(MethodBinding methodBinding, MatchLocator locator, SimpleSet knownMethods) throws org.eclipse.core.runtime.CoreException - Throws:
org.eclipse.core.runtime.CoreException
-
resolveLevel
Description copied from class:PatternLocatorFinds 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:
resolveLevelin classPatternLocator
-
resolveLevel
Description copied from class:PatternLocatorFinds 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:
resolveLevelin classPatternLocator
-
resolveLevel
-
resolveLevel
-
resolveLevelAsSubtype
protected int resolveLevelAsSubtype(char[] simplePattern, char[] qualifiedPattern, ReferenceBinding type, char[] methodName, TypeBinding[] argumentTypes, char[] packageName, boolean isDefault) Returns whether the given reference type binding matches or is a subtype of a type that matches the given qualified pattern. Returns ACCURATE_MATCH if it does. Returns INACCURATE_MATCH if resolve fails Returns IMPOSSIBLE_MATCH if it doesn't. -
toString
- Overrides:
toStringin classPatternLocator
-