本文整理汇总了Java中org.eclipse.jdt.core.dom.SuperMethodInvocation.resolveMethodBinding方法的典型用法代码示例。如果您正苦于以下问题:Java SuperMethodInvocation.resolveMethodBinding方法的具体用法?Java SuperMethodInvocation.resolveMethodBinding怎么用?Java SuperMethodInvocation.resolveMethodBinding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.dom.SuperMethodInvocation
的用法示例。
在下文中一共展示了SuperMethodInvocation.resolveMethodBinding方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.eclipse.jdt.core.dom.SuperMethodInvocation; //导入方法依赖的package包/类
public boolean visit(SuperMethodInvocation node) {
IMethodBinding mmtb = node.resolveMethodBinding();
if (mtbStack.isEmpty()) // not part of a method
return true;
// make field access fact
try {
facts.add(Fact.makeCallsFact(getQualifiedName(mtbStack.peek()),
getQualifiedName(mmtb)));
} catch (Exception e) {
System.err.println("Cannot resolve method invocation \""
+ node.getName().toString() + "\"");
}
return true;
}
示例2: visit
import org.eclipse.jdt.core.dom.SuperMethodInvocation; //导入方法依赖的package包/类
public boolean visit(SuperMethodInvocation node)
{
IMethodBinding mmtb = node.resolveMethodBinding();
if (this.mtbStack.isEmpty()) {
return true;
}
try
{
this.facts.add(Fact.makeCallsFact(getQualifiedName((IMethodBinding)this.mtbStack.peek()),
getQualifiedName(mmtb)));
}
catch (Exception e)
{
System.err.println("Cannot resolve method invocation \"" +
node.getName().toString() + "\"");
}
return true;
}
示例3: visit
import org.eclipse.jdt.core.dom.SuperMethodInvocation; //导入方法依赖的package包/类
public boolean visit(SuperMethodInvocation node)
{
IMethodBinding mmtb = node.resolveMethodBinding();
if (this.mtbStack.isEmpty()) {
return true;
}
try
{
this.facts.add(Fact.makeCallsFact(getQualifiedName((IMethodBinding)this.mtbStack.peek()),
getQualifiedName(mmtb)));
}
catch (Exception localException)
{
System.err.println("Cannot resolve method invocation \"" +
node.getName().toString() + "\"");
}
return true;
}
示例4: retrieveResultReference
import org.eclipse.jdt.core.dom.SuperMethodInvocation; //导入方法依赖的package包/类
private VariableReference retrieveResultReference(
SuperMethodInvocation superMethodInvocation) {
// TODO Duplicate code from retrieveResultReference(MethodInvocation)
// too bad they don't have a common matching interface
VariableReference result = calleeResultMap.get(superMethodInvocation.toString());
if (result != null) {
return result;
}
ASTNode parent = superMethodInvocation.getParent();
if (parent instanceof VariableDeclarationFragment) {
return retrieveVariableReference(parent, null);
}
if (parent instanceof Assignment) {
Assignment assignment = (Assignment) parent;
return retrieveVariableReference(assignment.getLeftHandSide(), null);
}
IMethodBinding methodBinding = superMethodInvocation.resolveMethodBinding();
result = retrieveVariableReference(methodBinding.getReturnType(), null);
calleeResultMap.put(superMethodInvocation.toString(), result);
return result;
}
示例5: endVisit
import org.eclipse.jdt.core.dom.SuperMethodInvocation; //导入方法依赖的package包/类
@Override
public final void endVisit(final SuperMethodInvocation node) {
final IMethodBinding superBinding= node.resolveMethodBinding();
if (superBinding != null) {
endVisit(node.arguments(), superBinding);
final MethodDeclaration declaration= fCurrentMethods.peek();
if (declaration != null) {
final IMethodBinding subBinding= declaration.resolveBinding();
if (subBinding != null) {
final ConstraintVariable2 ancestor= fModel.createReturnTypeVariable(superBinding);
if (ancestor != null) {
node.setProperty(PROPERTY_CONSTRAINT_VARIABLE, ancestor);
final ConstraintVariable2 descendant= fModel.createReturnTypeVariable(subBinding);
if (descendant != null)
fModel.createEqualityConstraint(descendant, ancestor);
}
}
}
}
}
示例6: visit
import org.eclipse.jdt.core.dom.SuperMethodInvocation; //导入方法依赖的package包/类
@Override
public boolean visit(SuperMethodInvocation loc) {
if (currentMethod == null)
return false;
if (loc.resolveMethodBinding() == null)
return false;
if (loc.resolveMethodBinding().getMethodDeclaration() == null || loc.resolveMethodBinding().getMethodDeclaration().getJavaElement() == null)
return true;
if (loc.resolveMethodBinding().getMethodDeclaration().getJavaElement().isReadOnly())
return true;
addCalledMethod(loc.resolveMethodBinding().getMethodDeclaration());
return true;
}
示例7: visit
import org.eclipse.jdt.core.dom.SuperMethodInvocation; //导入方法依赖的package包/类
@Override
public boolean visit(SuperMethodInvocation node) {
IMethodBinding methodBinding = node.resolveMethodBinding();
if (methodBinding != null)
if (methodBinding.getJavaElement().equals(accessedMethod))
this.encounteredThisReceiver = true;
return super.visit(node);
}
开发者ID:ponder-lab,项目名称:Migrate-Skeletal-Implementation-to-Interface-Refactoring,代码行数:9,代码来源:MethodReceiverAnalysisVisitor.java
示例8: create
import org.eclipse.jdt.core.dom.SuperMethodInvocation; //导入方法依赖的package包/类
@Override
public ITypeConstraint[] create(SuperMethodInvocation invocation) {
List<Expression> arguments = invocation.arguments();
List<ITypeConstraint> result = new ArrayList<ITypeConstraint>(arguments.size());
IMethodBinding methodBinding = invocation.resolveMethodBinding();
ITypeConstraint[] returnTypeConstraint = getReturnTypeConstraint(invocation, methodBinding);
result.addAll(Arrays.asList(returnTypeConstraint));
result.addAll(Arrays.asList(getArgumentConstraints(arguments, methodBinding)));
return result.toArray(new ITypeConstraint[result.size()]);
}
示例9: create
import org.eclipse.jdt.core.dom.SuperMethodInvocation; //导入方法依赖的package包/类
@Override
public ITypeConstraint[] create(SuperMethodInvocation invocation){
List<Expression> arguments= invocation.arguments();
List<ITypeConstraint> result= new ArrayList<ITypeConstraint>(arguments.size());
IMethodBinding methodBinding= invocation.resolveMethodBinding();
ITypeConstraint[] returnTypeConstraint= getReturnTypeConstraint(invocation, methodBinding);
result.addAll(Arrays.asList(returnTypeConstraint));
result.addAll(Arrays.asList(getArgumentConstraints(arguments, methodBinding)));
return result.toArray(new ITypeConstraint[result.size()]);
}