当前位置: 首页>>代码示例>>Java>>正文


Java ConstructorInvocation.resolveConstructorBinding方法代码示例

本文整理汇总了Java中org.eclipse.jdt.core.dom.ConstructorInvocation.resolveConstructorBinding方法的典型用法代码示例。如果您正苦于以下问题:Java ConstructorInvocation.resolveConstructorBinding方法的具体用法?Java ConstructorInvocation.resolveConstructorBinding怎么用?Java ConstructorInvocation.resolveConstructorBinding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jdt.core.dom.ConstructorInvocation的用法示例。


在下文中一共展示了ConstructorInvocation.resolveConstructorBinding方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visit

import org.eclipse.jdt.core.dom.ConstructorInvocation; //导入方法依赖的package包/类
public boolean visit(ConstructorInvocation node) {
	IMethodBinding mmtb = node.resolveConstructorBinding();

	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 constructor invocation in \""
				+ "\"");
	}
	return true;
}
 
开发者ID:aserg-ufmg,项目名称:RefDiff,代码行数:17,代码来源:ASTVisitorAtomicChange.java

示例2: visit

import org.eclipse.jdt.core.dom.ConstructorInvocation; //导入方法依赖的package包/类
public boolean visit(ConstructorInvocation node)
{
  IMethodBinding mmtb = node.resolveConstructorBinding();
  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 constructor invocation in \"\"");
  }
  return true;
}
 
开发者ID:SEAL-UCLA,项目名称:Ref-Finder,代码行数:18,代码来源:ASTVisitorAtomicChange.java

示例3: visit

import org.eclipse.jdt.core.dom.ConstructorInvocation; //导入方法依赖的package包/类
public boolean visit(ConstructorInvocation node)
{
  IMethodBinding mmtb = node.resolveConstructorBinding();
  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 constructor invocation in \"\"");
  }
  return true;
}
 
开发者ID:SEAL-UCLA,项目名称:Ref-Finder,代码行数:18,代码来源:ASTVisitorAtomicChange.java

示例4: visit

import org.eclipse.jdt.core.dom.ConstructorInvocation; //导入方法依赖的package包/类
@Override
public boolean visit(ConstructorInvocation loc) {
	if (currentMethod == null)
		return false;
	if (loc.resolveConstructorBinding() == null)
		return false;
	if (loc.resolveConstructorBinding().getMethodDeclaration() == null || loc.resolveConstructorBinding().getMethodDeclaration().getJavaElement() == null)
		return true;
	if (loc.resolveConstructorBinding().getMethodDeclaration().getJavaElement().isReadOnly())
		return true;
	if (loc.resolveConstructorBinding().getJavaElement() != null)
		addCalledMethod(loc.resolveConstructorBinding());
	return true;
}
 
开发者ID:ioanaverebi,项目名称:Sparrow,代码行数:15,代码来源:OutCodeVisitor.java

示例5: callsWritingConstructor

import org.eclipse.jdt.core.dom.ConstructorInvocation; //导入方法依赖的package包/类
private boolean callsWritingConstructor(
    MethodDeclaration methodDeclaration,
    HashSet<IMethodBinding> writingConstructorBindings,
    Set<MethodDeclaration> visitedMethodDeclarations) {
  Block body = methodDeclaration.getBody();
  if (body == null) return false;

  List<Statement> statements = body.statements();
  if (statements.size() == 0) return false;

  Statement statement = statements.get(0);
  if (!(statement instanceof ConstructorInvocation)) return false;

  ConstructorInvocation invocation = (ConstructorInvocation) statement;
  IMethodBinding constructorBinding = invocation.resolveConstructorBinding();
  if (constructorBinding == null) return false;

  if (writingConstructorBindings.contains(constructorBinding)) {
    return true;
  } else {
    ASTNode declaration =
        ASTNodes.findDeclaration(constructorBinding, methodDeclaration.getParent());
    if (!(declaration instanceof MethodDeclaration)) return false;

    if (visitedMethodDeclarations.contains(declaration)) {
      return false;
    }
    visitedMethodDeclarations.add(methodDeclaration);
    return callsWritingConstructor(
        (MethodDeclaration) declaration, writingConstructorBindings, visitedMethodDeclarations);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:33,代码来源:VariableDeclarationFix.java

示例6: create

import org.eclipse.jdt.core.dom.ConstructorInvocation; //导入方法依赖的package包/类
@Override
public ITypeConstraint[] create(ConstructorInvocation invocation) {
  List<Expression> arguments = invocation.arguments();
  List<ITypeConstraint> result = new ArrayList<ITypeConstraint>(arguments.size());
  IMethodBinding methodBinding = invocation.resolveConstructorBinding();
  result.addAll(Arrays.asList(getArgumentConstraints(arguments, methodBinding)));
  return result.toArray(new ITypeConstraint[result.size()]);
}
 
开发者ID:eclipse,项目名称:che,代码行数:9,代码来源:FullConstraintCreator.java

示例7: visit

import org.eclipse.jdt.core.dom.ConstructorInvocation; //导入方法依赖的package包/类
@Override
public boolean visit(ConstructorInvocation node) {
  // XXX Hack for performance reasons (should loop over fJobSemanticHighlightings can call
  // consumes(*))
  if (fJobDeprecatedMemberHighlighting != null) {
    IMethodBinding constructorBinding = node.resolveConstructorBinding();
    if (constructorBinding != null && constructorBinding.isDeprecated()) {
      int offset = node.getStartPosition();
      int length = 4;
      if (offset > -1 && length > 0)
        addPosition(offset, length, fJobDeprecatedMemberHighlighting);
    }
  }
  return true;
}
 
开发者ID:eclipse,项目名称:che,代码行数:16,代码来源:SemanticHighlightingReconciler.java

示例8: create

import org.eclipse.jdt.core.dom.ConstructorInvocation; //导入方法依赖的package包/类
@Override
public ITypeConstraint[] create(ConstructorInvocation invocation){
	List<Expression> arguments= invocation.arguments();
	List<ITypeConstraint> result= new ArrayList<ITypeConstraint>(arguments.size());
	IMethodBinding methodBinding= invocation.resolveConstructorBinding();
	result.addAll(Arrays.asList(getArgumentConstraints(arguments, methodBinding)));
	return result.toArray(new ITypeConstraint[result.size()]);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:9,代码来源:FullConstraintCreator.java

示例9: callsWritingConstructor

import org.eclipse.jdt.core.dom.ConstructorInvocation; //导入方法依赖的package包/类
private boolean callsWritingConstructor(MethodDeclaration methodDeclaration, HashSet<IMethodBinding> writingConstructorBindings, Set<MethodDeclaration> visitedMethodDeclarations) {
	Block body= methodDeclaration.getBody();
	if (body == null)
		return false;

	List<Statement> statements= body.statements();
	if (statements.size() == 0)
		return false;

	Statement statement= statements.get(0);
	if (!(statement instanceof ConstructorInvocation))
		return false;

	ConstructorInvocation invocation= (ConstructorInvocation)statement;
	IMethodBinding constructorBinding= invocation.resolveConstructorBinding();
	if (constructorBinding == null)
		return false;

	if (writingConstructorBindings.contains(constructorBinding)) {
		return true;
	} else {
		ASTNode declaration= ASTNodes.findDeclaration(constructorBinding, methodDeclaration.getParent());
		if (!(declaration instanceof MethodDeclaration))
			return false;

		if (visitedMethodDeclarations.contains(declaration)) {
			return false;
		}
		visitedMethodDeclarations.add(methodDeclaration);
		return callsWritingConstructor((MethodDeclaration)declaration, writingConstructorBindings, visitedMethodDeclarations);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:33,代码来源:VariableDeclarationFix.java

示例10: visit

import org.eclipse.jdt.core.dom.ConstructorInvocation; //导入方法依赖的package包/类
@Override
public boolean visit(ConstructorInvocation node) {
	// XXX Hack for performance reasons (should loop over fJobSemanticHighlightings can call consumes(*))
	if (fJobDeprecatedMemberHighlighting != null) {
		IMethodBinding constructorBinding= node.resolveConstructorBinding();
		if (constructorBinding != null && constructorBinding.isDeprecated()) {
			int offset= node.getStartPosition();
			int length= 4;
			if (offset > -1 && length > 0)
				addPosition(offset, length, fJobDeprecatedMemberHighlighting);
		}
	}
	return true;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:15,代码来源:SemanticHighlightingReconciler.java

示例11: getBindingForConstructorInvocation

import org.eclipse.jdt.core.dom.ConstructorInvocation; //导入方法依赖的package包/类
public Binding getBindingForConstructorInvocation(final ConstructorInvocation constructorCall) {
	Binding result = null;
	IMethodBinding binding = constructorCall.resolveConstructorBinding();
	if (binding == null || binding.getDeclaringClass() == null) {
		if (this.logJDTBindingsIssues) {
			MoDiscoLogger.logWarning("*** WARNING : binding '" //$NON-NLS-1$
					+ constructorCall.toString() + "' unresolved.", //$NON-NLS-1$
					JavaActivator.getDefault());
		}
		result = new UnresolvedBinding(constructorCall.toString());
	} else {
		result = getMethodBinding(binding);
	}
	return result;
}
 
开发者ID:markus1978,项目名称:srcrepo,代码行数:16,代码来源:JDTDelegateBindingFactory.java

示例12: endVisit

import org.eclipse.jdt.core.dom.ConstructorInvocation; //导入方法依赖的package包/类
@Override
public final void endVisit(final ConstructorInvocation node) {
	final IMethodBinding binding= node.resolveConstructorBinding();
	if (binding != null)
		endVisit(node.arguments(), binding);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:SuperTypeConstraintsCreator.java


注:本文中的org.eclipse.jdt.core.dom.ConstructorInvocation.resolveConstructorBinding方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。