本文整理汇总了Java中org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.getExactMethod方法的典型用法代码示例。如果您正苦于以下问题:Java ReferenceBinding.getExactMethod方法的具体用法?Java ReferenceBinding.getExactMethod怎么用?Java ReferenceBinding.getExactMethod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
的用法示例。
在下文中一共展示了ReferenceBinding.getExactMethod方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findMethodForArray
import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; //导入方法依赖的package包/类
public MethodBinding findMethodForArray(ArrayBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) {
ReferenceBinding object = getJavaLangObject();
MethodBinding methodBinding = object.getExactMethod(selector, argumentTypes, null);
if (methodBinding != null) {
// handle the method clone() specially... cannot be protected or throw exceptions
if (argumentTypes == Binding.NO_PARAMETERS && CharOperation.equals(selector, TypeConstants.CLONE))
return new MethodBinding((methodBinding.modifiers & ~ClassFileConstants.AccProtected) | ClassFileConstants.AccPublic, TypeConstants.CLONE, methodBinding.returnType, argumentTypes, null, object);
if (canBeSeenByForCodeSnippet(methodBinding, receiverType, invocationSite, this))
return methodBinding;
}
// answers closest approximation, may not check argumentTypes or visibility
methodBinding = findMethod(object, selector, argumentTypes, invocationSite, false);
if (methodBinding == null)
return new ProblemMethodBinding(selector, argumentTypes, ProblemReasons.NotFound);
if (methodBinding.isValidBinding()) {
MethodBinding compatibleMethod = computeCompatibleMethod(methodBinding, argumentTypes, invocationSite, Scope.FULL_INFERENCE);
if (compatibleMethod == null)
return new ProblemMethodBinding(methodBinding, selector, argumentTypes, ProblemReasons.NotFound);
methodBinding = compatibleMethod;
if (!canBeSeenByForCodeSnippet(methodBinding, receiverType, invocationSite, this))
return new ProblemMethodBinding(methodBinding, selector, methodBinding.parameters, ProblemReasons.NotVisible);
}
return methodBinding;
}
示例2: findMethodForArray
import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; //导入方法依赖的package包/类
public MethodBinding findMethodForArray(ArrayBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) {
ReferenceBinding object = getJavaLangObject();
MethodBinding methodBinding = object.getExactMethod(selector, argumentTypes, null);
if (methodBinding != null) {
// handle the method clone() specially... cannot be protected or throw exceptions
if (argumentTypes == Binding.NO_PARAMETERS && CharOperation.equals(selector, TypeConstants.CLONE))
return new MethodBinding((methodBinding.modifiers & ~ClassFileConstants.AccProtected) | ClassFileConstants.AccPublic, TypeConstants.CLONE, methodBinding.returnType, argumentTypes, null, object);
if (canBeSeenByForCodeSnippet(methodBinding, receiverType, invocationSite, this))
return methodBinding;
}
// answers closest approximation, may not check argumentTypes or visibility
methodBinding = findMethod(object, selector, argumentTypes, invocationSite);
if (methodBinding == null)
return new ProblemMethodBinding(selector, argumentTypes, ProblemReasons.NotFound);
if (methodBinding.isValidBinding()) {
MethodBinding compatibleMethod = computeCompatibleMethod(methodBinding, argumentTypes, invocationSite);
if (compatibleMethod == null)
return new ProblemMethodBinding(methodBinding, selector, argumentTypes, ProblemReasons.NotFound);
methodBinding = compatibleMethod;
if (!canBeSeenByForCodeSnippet(methodBinding, receiverType, invocationSite, this))
return new ProblemMethodBinding(methodBinding, selector, methodBinding.parameters, ProblemReasons.NotVisible);
}
return methodBinding;
}
示例3: findExactMethod
import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; //导入方法依赖的package包/类
public MethodBinding findExactMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) {
MethodBinding exactMethod = receiverType.getExactMethod(selector, argumentTypes, null);
if (exactMethod != null){
if (receiverType.isInterface() || canBeSeenByForCodeSnippet(exactMethod, receiverType, invocationSite, this))
return exactMethod;
}
return null;
}