Java Code Examples for org.eclipse.jdt.internal.corext.dom.Bindings#areOverriddenMethods()

The following examples show how to use org.eclipse.jdt.internal.corext.dom.Bindings#areOverriddenMethods() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NewAsyncRemoteServiceInterfaceCreationWizardPage.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * NOTE: This method comes from StubUtility2.
 */
@SuppressWarnings("deprecation")
private static IMethodBinding findOverridingMethod(IMethodBinding method,
    List<IMethodBinding> allMethods) {
  for (IMethodBinding cur : allMethods) {
    if (Bindings.areOverriddenMethods(cur, method)
        || Bindings.isSubsignature(cur, method)) {
      return cur;
    }
  }
  return null;
}
 
Example 2
Source File: StubUtility2.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private static IMethodBinding findOverridingMethod(IMethodBinding method, List<IMethodBinding> allMethods) {
	for (int i= 0; i < allMethods.size(); i++) {
		IMethodBinding curr= allMethods.get(i);
		if (Bindings.areOverriddenMethods(curr, method) || Bindings.isSubsignature(curr, method))
			return curr;
	}
	return null;
}
 
Example 3
Source File: StubUtility2.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private static void getDelegatableMethods(List<IMethodBinding> methods, IVariableBinding fieldBinding, ITypeBinding typeBinding, ITypeBinding binding, List<DelegateEntry> result) {
	boolean match= false;
	if (typeBinding.isTypeVariable()) {
		ITypeBinding[] typeBounds= typeBinding.getTypeBounds();
		if (typeBounds.length > 0) {
			for (int i= 0; i < typeBounds.length; i++) {
				getDelegatableMethods(methods, fieldBinding, typeBounds[i], binding, result);
			}
		} else {
			ITypeBinding objectBinding= Bindings.findTypeInHierarchy(binding, "java.lang.Object"); //$NON-NLS-1$
			if (objectBinding != null) {
				getDelegatableMethods(methods, fieldBinding, objectBinding, binding, result);
			}
		}
	} else {
		IMethodBinding[] candidates= getDelegateCandidates(typeBinding, binding);
		for (int index= 0; index < candidates.length; index++) {
			match= false;
			final IMethodBinding methodBinding= candidates[index];
			for (int offset= 0; offset < methods.size() && !match; offset++) {
				if (Bindings.areOverriddenMethods(methods.get(offset), methodBinding))
					match= true;
			}
			if (!match) {
				result.add(new DelegateEntry(methodBinding, fieldBinding));
				methods.add(methodBinding);
			}
		}
		final ITypeBinding superclass= typeBinding.getSuperclass();
		if (superclass != null)
			getDelegatableMethods(methods, fieldBinding, superclass, binding, result);
		ITypeBinding[] superInterfaces= typeBinding.getInterfaces();
		for (int offset= 0; offset < superInterfaces.length; offset++)
			getDelegatableMethods(methods, fieldBinding, superInterfaces[offset], binding, result);
	}
}