Example usage for org.eclipse.jdt.internal.compiler.ast LambdaExpression getMethodBinding

List of usage examples for org.eclipse.jdt.internal.compiler.ast LambdaExpression getMethodBinding

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.ast LambdaExpression getMethodBinding.

Prototype

@Override
    public MethodBinding getMethodBinding() 

Source Link

Usage

From source file:spoon.support.compiler.jdt.JDTTreeBuilder.java

License:Open Source License

@Override
public boolean visit(LambdaExpression lambdaExpression, BlockScope blockScope) {
    CtLambda<?> lambda = factory.Core().createLambda();

    final MethodBinding methodBinding = lambdaExpression.getMethodBinding();
    if (methodBinding != null) {
        lambda.setSimpleName(String.valueOf(methodBinding.constantPoolName()));
    }/*ww  w  .j ava2  s  .  c  o m*/

    context.enter(lambda, lambdaExpression);

    final Argument[] arguments = lambdaExpression.arguments();
    if (arguments != null && arguments.length > 0) {
        for (Argument e : arguments) {
            e.traverse(this, blockScope);
        }
    }

    if (lambdaExpression.body() != null) {
        lambdaExpression.body().traverse(this, blockScope);
    }

    return false;
}