public TypeReferenceMatch newTypeReferenceMatch( IJavaElement enclosingElement, Binding enclosingBinding, int accuracy, ASTNode reference) { return newTypeReferenceMatch(enclosingElement, enclosingBinding, accuracy, reference.sourceStart, reference.sourceEnd-reference.sourceStart+1, reference); }
public TypeReferenceMatch newTypeReferenceMatch( IJavaElement enclosingElement, Binding enclosingBinding, int accuracy, ASTNode reference) { return newTypeReferenceMatch(enclosingElement, enclosingBinding, accuracy, reference.sourceStart, reference.sourceEnd-reference.sourceStart+1, reference); }
public TypeReferenceMatch newTypeReferenceMatch( IJavaElement enclosingElement, Binding enclosingBinding, int accuracy, ASTNode reference) { return newTypeReferenceMatch(enclosingElement, enclosingBinding, accuracy, reference.sourceStart, reference.sourceEnd-reference.sourceStart+1, reference); }
public TypeReferenceMatch newTypeReferenceMatch( IJavaElement enclosingElement, Binding enclosingBinding, int accuracy, ASTNode reference) { return newTypeReferenceMatch(enclosingElement, enclosingBinding, accuracy, reference.sourceStart, reference.sourceEnd-reference.sourceStart+1, reference); }
public TypeReferenceMatch newTypeReferenceMatch( IJavaElement enclosingElement, Binding enclosingBinding, int accuracy, ASTNode reference) { return newTypeReferenceMatch(enclosingElement, enclosingBinding, accuracy, reference.sourceStart, reference.sourceEnd-reference.sourceStart+1, reference); }
public TypeReferenceMatch newTypeReferenceMatch( IJavaElement enclosingElement, Binding enclosingBinding, int accuracy, ASTNode reference) { return newTypeReferenceMatch(enclosingElement, enclosingBinding, accuracy, reference.sourceStart, reference.sourceEnd-reference.sourceStart+1, reference); }
private void matchTypeReferences(MatchLocator locator, TypeReferencePattern typeReferencePattern, TypeBinding[] types) throws CoreException { if (types == null) return; for (TypeBinding type : types) { int level = locator.patternLocator.resolveLevel(type); if (level == PatternLocator.IMPOSSIBLE_MATCH) continue; int accuracy = level == PatternLocator.ACCURATE_MATCH ? SearchMatch.A_ACCURATE : SearchMatch.A_INACCURATE; TypeReferenceMatch match = locator.newTypeReferenceMatch(this.moduleDesc, null, accuracy, -1, 0, null); locator.report(match); } } }
private void matchTypeReferences(MatchLocator locator, TypeReferencePattern typeReferencePattern, TypeBinding[] types) throws CoreException { if (types == null) return; for (TypeBinding type : types) { int level = locator.patternLocator.resolveLevel(type); if (level == PatternLocator.IMPOSSIBLE_MATCH) continue; int accuracy = level == PatternLocator.ACCURATE_MATCH ? SearchMatch.A_ACCURATE : SearchMatch.A_INACCURATE; TypeReferenceMatch match = locator.newTypeReferenceMatch(this.moduleDesc, null, accuracy, -1, 0, null); locator.report(match); } } }
protected void matchReportReference(ArrayTypeReference arrayRef, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { if (this.pattern.simpleName == null) { // TODO (frederic) need to add a test for this case while searching generic types... if (locator.encloses(element)) { int offset = arrayRef.sourceStart; int length = arrayRef.sourceEnd-offset+1; if (this.match == null) { this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, offset, length, arrayRef); } else { this.match.setOffset(offset); this.match.setLength(length); } locator.report(this.match); return; } } this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, arrayRef); if (arrayRef.resolvedType != null) { matchReportReference(arrayRef, -1, arrayRef.resolvedType.leafComponentType(), locator); return; } locator.reportAccurateTypeReference(this.match, arrayRef, this.pattern.simpleName); } /**
protected void matchReportReference(ArrayTypeReference arrayRef, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { if (this.pattern.simpleName == null) { // TODO (frederic) need to add a test for this case while searching generic types... if (locator.encloses(element)) { int offset = arrayRef.sourceStart; int length = arrayRef.sourceEnd-offset+1; if (this.match == null) { this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, offset, length, arrayRef); } else { this.match.setOffset(offset); this.match.setLength(length); } locator.report(this.match); return; } } this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, arrayRef); if (arrayRef.resolvedType != null) { matchReportReference(arrayRef, -1, arrayRef.resolvedType.leafComponentType(), locator); return; } locator.reportAccurateTypeReference(this.match, arrayRef, this.pattern.simpleName); } /**
protected void matchReportReference(ArrayTypeReference arrayRef, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { if (this.pattern.simpleName == null) { // TODO (frederic) need to add a test for this case while searching generic types... if (locator.encloses(element)) { int offset = arrayRef.sourceStart; int length = arrayRef.sourceEnd-offset+1; if (this.match == null) { this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, offset, length, arrayRef); } else { this.match.setOffset(offset); this.match.setLength(length); } locator.report(this.match); return; } } this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, arrayRef); if (arrayRef.resolvedType != null) { matchReportReference(arrayRef, -1, arrayRef.resolvedType.leafComponentType(), locator); return; } locator.reportAccurateTypeReference(this.match, arrayRef, this.pattern.simpleName); } /**
protected void matchReportReference(ArrayTypeReference arrayRef, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { if (this.pattern.simpleName == null) { // TODO (frederic) need to add a test for this case while searching generic types... if (locator.encloses(element)) { int offset = arrayRef.sourceStart; int length = arrayRef.sourceEnd-offset+1; if (this.match == null) { this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, offset, length, arrayRef); } else { this.match.setOffset(offset); this.match.setLength(length); } locator.report(this.match); return; } } this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, arrayRef); if (arrayRef.resolvedType != null) { matchReportReference(arrayRef, -1, arrayRef.resolvedType.leafComponentType(), locator); return; } locator.reportAccurateTypeReference(this.match, arrayRef, this.pattern.simpleName); } /**
protected void matchReportReference(ArrayTypeReference arrayRef, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { if (this.pattern.simpleName == null) { // TODO (frederic) need to add a test for this case while searching generic types... if (locator.encloses(element)) { int offset = arrayRef.sourceStart; int length = arrayRef.sourceEnd-offset+1; if (this.match == null) { this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, offset, length, arrayRef); } else { this.match.setOffset(offset); this.match.setLength(length); } locator.report(this.match); return; } } this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, arrayRef); if (arrayRef.resolvedType != null) { matchReportReference(arrayRef, -1, arrayRef.resolvedType.leafComponentType(), locator); return; } locator.reportAccurateTypeReference(this.match, arrayRef, this.pattern.simpleName); } /**
protected void matchReportReference(ArrayTypeReference arrayRef, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { if (this.pattern.simpleName == null) { // TODO (frederic) need to add a test for this case while searching generic types... if (locator.encloses(element)) { int offset = arrayRef.sourceStart; int length = arrayRef.sourceEnd-offset+1; if (this.match == null) { this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, offset, length, arrayRef); } else { this.match.setOffset(offset); this.match.setLength(length); } locator.report(this.match); return; } } this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, arrayRef); if (arrayRef.resolvedType != null) { matchReportReference(arrayRef, -1, arrayRef.resolvedType.leafComponentType(), locator); return; } locator.reportAccurateTypeReference(this.match, arrayRef, this.pattern.simpleName); } /**
/** * Reports the match of the given reference. */ protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { this.match = null; int referenceType = referenceType(); int offset = reference.sourceStart; switch (referenceType) { case IJavaElement.PACKAGE_FRAGMENT: this.match = locator.newPackageReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.TYPE: this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.FIELD: this.match = locator.newFieldReferenceMatch(element, null, elementBinding, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.LOCAL_VARIABLE: this.match = locator.newLocalVariableReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.TYPE_PARAMETER: this.match = locator.newTypeParameterReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; } if (this.match != null) { locator.report(this.match); } } /**
/** * Reports the match of the given reference. */ protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { this.match = null; int referenceType = referenceType(); int offset = reference.sourceStart; switch (referenceType) { case IJavaElement.PACKAGE_FRAGMENT: this.match = locator.newPackageReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.TYPE: this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.FIELD: this.match = locator.newFieldReferenceMatch(element, null, elementBinding, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.LOCAL_VARIABLE: this.match = locator.newLocalVariableReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.TYPE_PARAMETER: this.match = locator.newTypeParameterReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; } if (this.match != null) { locator.report(this.match); } } /**
break; case IJavaElement.TYPE: this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.FIELD:
break; case IJavaElement.TYPE: this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.FIELD:
TypeReferenceMatch refMatch = locator.newTypeReferenceMatch(element, elementBinding, accuracy, reference); refMatch.setLocalElement(localElement); refMatch.setOtherElements(otherElements);
TypeReferenceMatch refMatch = locator.newTypeReferenceMatch(element, elementBinding, accuracy, reference); refMatch.setLocalElement(localElement); refMatch.setOtherElements(otherElements);