Example usage for org.eclipse.jdt.internal.compiler.ast ExplicitConstructorCall genericTypeArguments

List of usage examples for org.eclipse.jdt.internal.compiler.ast ExplicitConstructorCall genericTypeArguments

Introduction

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

Prototype

TypeBinding[] genericTypeArguments

To view the source code for org.eclipse.jdt.internal.compiler.ast ExplicitConstructorCall genericTypeArguments.

Click Source Link

Usage

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

License:Open Source License

@SuppressWarnings("unchecked")
@Override//from w w  w  .  ja v  a 2 s  .c  om
public boolean visit(ExplicitConstructorCall explicitConstructor, BlockScope scope) {
    CtInvocation<Object> inv = factory.Core().createInvocation();
    if (explicitConstructor.isImplicitSuper()) {
        inv.setImplicit(true);
    }
    CtExecutableReference<Object> er = references.getExecutableReference(explicitConstructor.binding);
    inv.setExecutable(er);
    inv.getExecutable().setType((CtTypeReference<Object>) inv.getExecutable().getDeclaringType());
    inv.setType(inv.getExecutable().getType());

    if (explicitConstructor.genericTypeArguments() != null) {
        inv.getExecutable().setActualTypeArguments(
                references.getBoundedTypesReferences(explicitConstructor.genericTypeArguments()));
    }

    context.enter(inv, explicitConstructor);

    if (explicitConstructor.qualification != null) {
        explicitConstructor.qualification.traverse(this, scope);
    }
    if (explicitConstructor.typeArguments != null) {
        for (int i = 0, typeArgumentsLength = explicitConstructor.typeArguments.length; i < typeArgumentsLength; i++) {
            explicitConstructor.typeArguments[i].traverse(this, scope);
        }
    }

    context.arguments.push(inv);
    if (explicitConstructor.arguments != null) {
        for (int i = 0, argumentLength = explicitConstructor.arguments.length; i < argumentLength; i++) {
            explicitConstructor.arguments[i].traverse(this, scope);
        }
    }
    context.arguments.pop();

    return false;
}