本文整理匯總了Java中org.eclipse.jdt.core.dom.IMethodBinding.overrides方法的典型用法代碼示例。如果您正苦於以下問題:Java IMethodBinding.overrides方法的具體用法?Java IMethodBinding.overrides怎麽用?Java IMethodBinding.overrides使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jdt.core.dom.IMethodBinding
的用法示例。
在下文中一共展示了IMethodBinding.overrides方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: visit
import org.eclipse.jdt.core.dom.IMethodBinding; //導入方法依賴的package包/類
@Override
public boolean visit(SimpleName node) {
IBinding binding= node.resolveBinding();
if (binding == null) {
return false;
}
binding= getDeclaration(binding);
if (fBinding == binding) {
fResult.add(node);
} else if (binding.getKind() != fBinding.getKind()) {
return false;
} else if (binding.getKind() == IBinding.METHOD) {
IMethodBinding curr= (IMethodBinding) binding;
IMethodBinding methodBinding= (IMethodBinding) fBinding;
if (methodBinding.overrides(curr) || curr.overrides(methodBinding)) {
fResult.add(node);
}
}
return false;
}
示例2: isDefinedInTypeOrSuperType
import org.eclipse.jdt.core.dom.IMethodBinding; //導入方法依賴的package包/類
private boolean isDefinedInTypeOrSuperType(final IMethodBinding methodBinding, ITypeBinding declaringClass) {
while (declaringClass != null) {
for (final IMethodBinding method : declaringClass.getDeclaredMethods()) {
if (methodBinding.overrides(method)) {
return true;
}
}
for (final ITypeBinding type : declaringClass.getInterfaces()) {
if (isDefinedInTypeOrSuperType(methodBinding, type)) {
return true;
}
}
declaringClass = declaringClass.getSuperclass();
}
return false;
}