本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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()]);
}
示例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;
}
示例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()]);
}
示例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);
}
}
示例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;
}
示例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);
}