Example usage for org.eclipse.jdt.core.dom SuperConstructorInvocation typeArguments

List of usage examples for org.eclipse.jdt.core.dom SuperConstructorInvocation typeArguments

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom SuperConstructorInvocation typeArguments.

Prototype

ASTNode.NodeList typeArguments

To view the source code for org.eclipse.jdt.core.dom SuperConstructorInvocation typeArguments.

Click Source Link

Document

The type arguments (element type: Type ).

Usage

From source file:at.bestsolution.fxide.jdt.corext.dom.ASTFlattener.java

License:Open Source License

@Override
public boolean visit(SuperConstructorInvocation node) {
    if (node.getExpression() != null) {
        node.getExpression().accept(this);
        this.fBuffer.append(".");//$NON-NLS-1$
    }//  w  w  w . j a  v  a 2 s.  c om
    if (node.getAST().apiLevel() >= JLS3) {
        if (!node.typeArguments().isEmpty()) {
            this.fBuffer.append("<");//$NON-NLS-1$
            for (Iterator<Type> it = node.typeArguments().iterator(); it.hasNext();) {
                Type t = it.next();
                t.accept(this);
                if (it.hasNext()) {
                    this.fBuffer.append(",");//$NON-NLS-1$
                }
            }
            this.fBuffer.append(">");//$NON-NLS-1$
        }
    }
    this.fBuffer.append("super(");//$NON-NLS-1$
    for (Iterator<Expression> it = node.arguments().iterator(); it.hasNext();) {
        Expression e = it.next();
        e.accept(this);
        if (it.hasNext()) {
            this.fBuffer.append(",");//$NON-NLS-1$
        }
    }
    this.fBuffer.append(");");//$NON-NLS-1$
    return false;
}

From source file:boa.datagen.util.Java7Visitor.java

License:Apache License

@Override
public boolean visit(SuperConstructorInvocation node) {
    boa.types.Ast.Statement.Builder b = boa.types.Ast.Statement.newBuilder();
    //      b.setPosition(pos.build());
    List<boa.types.Ast.Statement> list = statements.peek();
    b.setKind(boa.types.Ast.Statement.StatementKind.EXPRESSION);
    boa.types.Ast.Expression.Builder eb = boa.types.Ast.Expression.newBuilder();
    //      eb.setPosition(pos.build());//FIXME
    eb.setKind(boa.types.Ast.Expression.ExpressionKind.METHODCALL);
    eb.setMethod("super");
    if (node.getExpression() != null) {
        node.getExpression().accept(this);
        eb.addExpressions(expressions.pop());
    }/*from   w ww .  j a  v  a2 s. com*/
    for (Object a : node.arguments()) {
        ((org.eclipse.jdt.core.dom.Expression) a).accept(this);
        eb.addMethodArgs(expressions.pop());
    }
    for (Object t : node.typeArguments()) {
        boa.types.Ast.Type.Builder tb = boa.types.Ast.Type.newBuilder();
        tb.setName(getIndex(typeName((org.eclipse.jdt.core.dom.Type) t)));
        tb.setKind(boa.types.Ast.TypeKind.GENERIC);
        eb.addGenericParameters(tb.build());
    }
    b.setExpression(eb.build());
    list.add(b.build());
    return false;
}

From source file:coloredide.utils.CopiedNaiveASTFlattener.java

License:Open Source License

public boolean visit(SuperConstructorInvocation node) {
    printIndent();//from  ww w .  j a va  2 s.  c o  m
    if (node.getExpression() != null) {
        node.getExpression().accept(this);
        this.buffer.append(".");//$NON-NLS-1$
    }
    if (node.getAST().apiLevel() >= AST.JLS3) {
        if (!node.typeArguments().isEmpty()) {
            this.buffer.append("<");//$NON-NLS-1$
            for (Iterator it = node.typeArguments().iterator(); it.hasNext();) {
                Type t = (Type) it.next();
                t.accept(this);
                if (it.hasNext()) {
                    this.buffer.append(",");//$NON-NLS-1$
                }
            }
            this.buffer.append(">");//$NON-NLS-1$
        }
    }
    this.buffer.append("super(");//$NON-NLS-1$
    for (Iterator it = node.arguments().iterator(); it.hasNext();) {
        Expression e = (Expression) it.next();
        e.accept(this);
        if (it.hasNext()) {
            this.buffer.append(",");//$NON-NLS-1$
        }
    }
    this.buffer.append(");\n");//$NON-NLS-1$
    return false;
}

From source file:com.bsiag.eclipse.jdt.java.formatter.SpacePreparator.java

License:Open Source License

@Override
public boolean visit(SuperConstructorInvocation node) {
    handleTypeArguments(node.typeArguments());
    handleInvocation(node, node);/* w  ww . ja v a2s .c om*/
    handleCommas(node.arguments(),
            this.options.insert_space_before_comma_in_explicit_constructor_call_arguments,
            this.options.insert_space_after_comma_in_explicit_constructor_call_arguments);
    return true;
}

From source file:com.google.googlejavaformat.java.JavaInputAstVisitor.java

License:Apache License

/** Visitor method for {@link SuperConstructorInvocation}s. */
@Override/*from   w w w .  j a  v a2 s . co  m*/
public boolean visit(SuperConstructorInvocation node) {
    sync(node);
    if (node.getExpression() != null) {
        node.getExpression().accept(this);
        token(".");
    }
    addTypeArguments(node.typeArguments(), plusFour);
    token("super");
    addArguments(node.arguments(), plusFour);
    token(";");
    return false;
}

From source file:lang.java.jdt.internal.JdtAstToRascalAstConverter.java

License:Open Source License

public boolean visit(SuperConstructorInvocation node) {
    IValue expression = node.getExpression() == null ? null : visitChild(node.getExpression());

    IValueList genericTypes = new IValueList(values);
    if (node.getAST().apiLevel() >= AST.JLS3) {
        if (!node.typeArguments().isEmpty()) {
            for (Iterator it = node.typeArguments().iterator(); it.hasNext();) {
                Type t = (Type) it.next();
                genericTypes.add(visitChild(t));
            }//  ww w. j  a va2 s  .  c  o m
        }
    }

    IValueList arguments = new IValueList(values);
    for (Iterator it = node.arguments().iterator(); it.hasNext();) {
        Expression e = (Expression) it.next();
        arguments.add(visitChild(e));
    }

    ownValue = constructRascalNode(node, optional(expression), genericTypes.asList(), arguments.asList());
    return false;
}

From source file:org.codemucker.jmutate.ast.JAstFlattener.java

License:Open Source License

public boolean visit(SuperConstructorInvocation node) {
    printIndent();/*www. j  av  a 2  s . co  m*/
    if (node.getExpression() != null) {
        node.getExpression().accept(this);
        this.buffer.append(".");//$NON-NLS-1$
    }
    if (node.getAST().apiLevel() >= JLS3) {
        if (!node.typeArguments().isEmpty()) {
            this.buffer.append("<");//$NON-NLS-1$
            for (Iterator it = node.typeArguments().iterator(); it.hasNext();) {
                Type t = (Type) it.next();
                t.accept(this);
                if (it.hasNext()) {
                    this.buffer.append(",");//$NON-NLS-1$
                }
            }
            this.buffer.append(">");//$NON-NLS-1$
        }
    }
    this.buffer.append("super(");//$NON-NLS-1$
    for (Iterator it = node.arguments().iterator(); it.hasNext();) {
        Expression e = (Expression) it.next();
        e.accept(this);
        if (it.hasNext()) {
            this.buffer.append(",");//$NON-NLS-1$
        }
    }
    this.buffer.append(");\n");//$NON-NLS-1$
    return false;
}

From source file:org.eclipse.emf.texo.generator.ImportReferenceCollector.java

License:Open Source License

@Override
public boolean visit(final SuperConstructorInvocation node) {
    evalQualifyingExpression(node.getExpression(), null);
    doVisitChildren(node.typeArguments());
    doVisitChildren(node.arguments());//from  w  w  w.  j a v  a2s .  co m
    return false;
}

From source file:org.eclipse.jdt.core.dom.ASTConverter.java

License:Open Source License

public Statement convert(org.eclipse.jdt.internal.compiler.ast.ExplicitConstructorCall statement) {
    Statement newStatement;/*from w w  w . j av  a2 s.  c  o m*/
    int sourceStart = statement.sourceStart;
    if (statement.isSuperAccess() || statement.isSuper()) {
        SuperConstructorInvocation superConstructorInvocation = new SuperConstructorInvocation(this.ast);
        if (statement.qualification != null) {
            superConstructorInvocation.setExpression(convert(statement.qualification));
        }
        org.eclipse.jdt.internal.compiler.ast.Expression[] arguments = statement.arguments;
        if (arguments != null) {
            int length = arguments.length;
            for (int i = 0; i < length; i++) {
                superConstructorInvocation.arguments().add(convert(arguments[i]));
            }
        }
        if (statement.typeArguments != null) {
            if (sourceStart > statement.typeArgumentsSourceStart) {
                sourceStart = statement.typeArgumentsSourceStart;
            }
            switch (this.ast.apiLevel) {
            case AST.JLS2_INTERNAL:
                superConstructorInvocation.setFlags(superConstructorInvocation.getFlags() | ASTNode.MALFORMED);
                break;
            default:
                for (int i = 0, max = statement.typeArguments.length; i < max; i++) {
                    superConstructorInvocation.typeArguments().add(convertType(statement.typeArguments[i]));
                }
                break;
            }
        }
        newStatement = superConstructorInvocation;
    } else {
        ConstructorInvocation constructorInvocation = new ConstructorInvocation(this.ast);
        org.eclipse.jdt.internal.compiler.ast.Expression[] arguments = statement.arguments;
        if (arguments != null) {
            int length = arguments.length;
            for (int i = 0; i < length; i++) {
                constructorInvocation.arguments().add(convert(arguments[i]));
            }
        }
        if (statement.typeArguments != null) {
            if (sourceStart > statement.typeArgumentsSourceStart) {
                sourceStart = statement.typeArgumentsSourceStart;
            }
            switch (this.ast.apiLevel) {
            case AST.JLS2_INTERNAL:
                constructorInvocation.setFlags(constructorInvocation.getFlags() | ASTNode.MALFORMED);
                break;
            default:
                for (int i = 0, max = statement.typeArguments.length; i < max; i++) {
                    constructorInvocation.typeArguments().add(convertType(statement.typeArguments[i]));
                }
                break;
            }
        }
        if (statement.qualification != null) {
            // this is an error
            constructorInvocation.setFlags(constructorInvocation.getFlags() | ASTNode.MALFORMED);
        }
        newStatement = constructorInvocation;
    }
    newStatement.setSourceRange(sourceStart, statement.sourceEnd - sourceStart + 1);
    if (this.resolveBindings) {
        recordNodes(newStatement, statement);
    }
    return newStatement;
}

From source file:org.eclipse.modisco.java.discoverer.internal.io.java.JDTVisitor.java

License:Open Source License

@Override
public void endVisit(final org.eclipse.jdt.core.dom.SuperConstructorInvocation node) {
    SuperConstructorInvocation element = (SuperConstructorInvocation) this.binding.get(node);
    initializeNode(element, node);/*from www.j av  a 2s .  com*/

    if (this.binding.get(node.getExpression()) != null) {
        element.setExpression(JDTVisitorUtils.completeExpression(this.binding.get(node.getExpression()), this));
    }

    for (Iterator<?> i = node.arguments().iterator(); i.hasNext();) {
        ASTNode itElement = this.binding.get(i.next());
        if (itElement != null) {
            element.getArguments().add(JDTVisitorUtils.completeExpression(itElement, this));
        }
    }

    for (Iterator<?> i = node.typeArguments().iterator(); i.hasNext();) {
        ASTNode itElement = this.binding.get(i.next());
        if (itElement != null) {
            element.getTypeArguments().add(JDTVisitorUtils.completeTypeAccess(itElement, this));
        }
    }

    PendingElement constructorRef = new PendingElement(this.factory);
    constructorRef.setClientNode(element);
    constructorRef.setLinkName("method"); //$NON-NLS-1$

    JDTVisitorUtils.manageBindingRef(constructorRef, node, this);
}