本文整理汇总了Java中org.eclipse.jdt.internal.compiler.lookup.MethodBinding.areParameterErasuresEqual方法的典型用法代码示例。如果您正苦于以下问题:Java MethodBinding.areParameterErasuresEqual方法的具体用法?Java MethodBinding.areParameterErasuresEqual怎么用?Java MethodBinding.areParameterErasuresEqual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.compiler.lookup.MethodBinding
的用法示例。
在下文中一共展示了MethodBinding.areParameterErasuresEqual方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findSuperMethodBinding
import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; //导入方法依赖的package包/类
/** Computes the super method, if any, given a method binding */
private static MethodBinding findSuperMethodBinding(@NonNull MethodBinding binding) {
try {
ReferenceBinding superclass = binding.declaringClass.superclass();
while (superclass != null) {
MethodBinding[] methods = superclass.getMethods(binding.selector,
binding.parameters.length);
for (MethodBinding method : methods) {
if (method.areParameterErasuresEqual(binding)) {
return method;
}
}
superclass = superclass.superclass();
}
} catch (Exception ignore) {
// Work around ECJ bugs; see https://code.google.com/p/android/issues/detail?id=172268
}
return null;
}
示例2: isSubsignature
import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; //导入方法依赖的package包/类
@Override
public boolean isSubsignature(ExecutableType m1, ExecutableType m2) {
MethodBinding methodBinding1 = (MethodBinding) ((ExecutableTypeImpl) m1)._binding;
MethodBinding methodBinding2 = (MethodBinding) ((ExecutableTypeImpl) m2)._binding;
if (!CharOperation.equals(methodBinding1.selector, methodBinding2.selector))
return false;
return methodBinding1.areParameterErasuresEqual(methodBinding2) && methodBinding1.areTypeVariableErasuresEqual(methodBinding2);
}
示例3: asMemberOf
import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; //导入方法依赖的package包/类
@Override
public TypeMirror asMemberOf(DeclaredType containing, Element element) {
// throw new UnsupportedOperationException("NYI: TypesImpl.asMemberOf(" + containing + ", " + element + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
ElementImpl elementImpl = (ElementImpl) element;
DeclaredTypeImpl declaredTypeImpl = (DeclaredTypeImpl) containing;
ReferenceBinding referenceBinding = (ReferenceBinding) declaredTypeImpl._binding;
switch(element.getKind()) {
case CONSTRUCTOR :
case METHOD :
MethodBinding methodBinding = (MethodBinding) elementImpl._binding;
if (TypeBinding.notEquals(methodBinding.declaringClass, referenceBinding)) {
throw new IllegalArgumentException("element is not valid for the containing declared type"); //$NON-NLS-1$
}
for (MethodBinding method : referenceBinding.methods()) {
if (CharOperation.equals(method.selector, methodBinding.selector)
&& method.areParameterErasuresEqual(methodBinding)) {
return this._env.getFactory().newTypeMirror(method);
}
}
break;
case FIELD :
case ENUM_CONSTANT:
FieldBinding fieldBinding = (FieldBinding) elementImpl._binding;
if (TypeBinding.notEquals(fieldBinding.declaringClass, referenceBinding)) {
throw new IllegalArgumentException("element is not valid for the containing declared type"); //$NON-NLS-1$
}
for (FieldBinding field : referenceBinding.fields()) {
if (CharOperation.equals(field.name, fieldBinding.name)) {
return this._env.getFactory().newTypeMirror(field);
}
}
break;
case ENUM :
case ANNOTATION_TYPE :
case INTERFACE :
case CLASS :
ReferenceBinding referenceBinding2 = (ReferenceBinding) elementImpl._binding;
if (TypeBinding.notEquals(referenceBinding2.enclosingType(), referenceBinding)) {
throw new IllegalArgumentException("element is not valid for the containing declared type"); //$NON-NLS-1$
}
for (ReferenceBinding referenceBinding3 : referenceBinding.memberTypes()) {
if (CharOperation.equals(referenceBinding3.compoundName, referenceBinding3.compoundName)) {
return this._env.getFactory().newTypeMirror(referenceBinding3);
}
}
break;
default:
break;
}
throw new IllegalArgumentException("element is not valid for the containing declared type: element kind " + element.getKind()); //$NON-NLS-1$
}
示例4: asMemberOf
import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; //导入方法依赖的package包/类
@Override
public TypeMirror asMemberOf(DeclaredType containing, Element element) {
// throw new UnsupportedOperationException("NYI: TypesImpl.asMemberOf(" + containing + ", " + element + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
ElementImpl elementImpl = (ElementImpl) element;
DeclaredTypeImpl declaredTypeImpl = (DeclaredTypeImpl) containing;
ReferenceBinding referenceBinding = (ReferenceBinding) declaredTypeImpl._binding;
switch(element.getKind()) {
case CONSTRUCTOR :
case METHOD :
MethodBinding methodBinding = (MethodBinding) elementImpl._binding;
if (methodBinding.declaringClass != referenceBinding) {
throw new IllegalArgumentException("element is not valid for the containing declared type"); //$NON-NLS-1$
}
for (MethodBinding method : referenceBinding.methods()) {
if (CharOperation.equals(method.selector, methodBinding.selector)
&& method.areParameterErasuresEqual(methodBinding)) {
return this._env.getFactory().newTypeMirror(method);
}
}
break;
case FIELD :
case ENUM_CONSTANT:
FieldBinding fieldBinding = (FieldBinding) elementImpl._binding;
if (fieldBinding.declaringClass != referenceBinding) {
throw new IllegalArgumentException("element is not valid for the containing declared type"); //$NON-NLS-1$
}
for (FieldBinding field : referenceBinding.fields()) {
if (CharOperation.equals(field.name, fieldBinding.name)) {
return this._env.getFactory().newTypeMirror(field);
}
}
break;
case ENUM :
case ANNOTATION_TYPE :
case INTERFACE :
case CLASS :
ReferenceBinding referenceBinding2 = (ReferenceBinding) elementImpl._binding;
if (referenceBinding2.enclosingType() != referenceBinding) {
throw new IllegalArgumentException("element is not valid for the containing declared type"); //$NON-NLS-1$
}
for (ReferenceBinding referenceBinding3 : referenceBinding.memberTypes()) {
if (CharOperation.equals(referenceBinding3.compoundName, referenceBinding3.compoundName)) {
return this._env.getFactory().newTypeMirror(referenceBinding3);
}
}
break;
default:
break;
}
throw new IllegalArgumentException("element is not valid for the containing declared type: element kind " + element.getKind()); //$NON-NLS-1$
}