Example usage for org.eclipse.jdt.core.dom VariableDeclaration accept

List of usage examples for org.eclipse.jdt.core.dom VariableDeclaration accept

Introduction

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

Prototype

public final void accept(ASTVisitor visitor) 

Source Link

Document

Accepts the given visitor on a visit of the current node.

Usage

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

License:Open Source License

@Override
public boolean visit(LambdaExpression node) {
    boolean hasParentheses = node.hasParentheses();
    if (hasParentheses)
        this.fBuffer.append('(');
    for (Iterator<? extends VariableDeclaration> it = node.parameters().iterator(); it.hasNext();) {
        VariableDeclaration v = it.next();
        v.accept(this);
        if (it.hasNext()) {
            this.fBuffer.append(",");//$NON-NLS-1$
        }/*from ww  w  .j  a  va 2s  .  c  om*/
    }
    if (hasParentheses)
        this.fBuffer.append(')');
    this.fBuffer.append(" -> "); //$NON-NLS-1$
    node.getBody().accept(this);
    return false;
}

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

License:Open Source License

public boolean visit(LambdaExpression node) {
    boolean hasParentheses = node.hasParentheses();
    if (hasParentheses)
        this.buffer.append('(');
    for (Iterator it = node.parameters().iterator(); it.hasNext();) {
        VariableDeclaration v = (VariableDeclaration) it.next();
        v.accept(this);
        if (it.hasNext()) {
            this.buffer.append(",");//$NON-NLS-1$
        }//from  w  ww  .j  a va2  s.  c  o m
    }
    if (hasParentheses)
        this.buffer.append(')');
    this.buffer.append(" -> "); //$NON-NLS-1$
    node.getBody().accept(this);
    return false;
}

From source file:parser.AnnotationType.java

License:Open Source License

public boolean visit(LambdaExpression node) {
    boolean hasParentheses = node.hasParentheses();
    this.buffer.append(strSplitCharacter);
    if (hasParentheses) {
        this.buffer.append('(');
        this.buffer.append(strSplitCharacter);
    }//from  w  w  w .j  a v  a 2  s .  c  o  m
    for (Iterator it = node.parameters().iterator(); it.hasNext();) {

        VariableDeclaration v = (VariableDeclaration) it.next();
        v.accept(this);
        this.buffer.append(strSplitCharacter);
        if (it.hasNext()) {
            this.buffer.append(strSplitCharacter);
            this.buffer.append(",");//$NON-NLS-1$
            this.buffer.append(strSplitCharacter);
        }
    }
    if (hasParentheses) {
        this.buffer.append(strSplitCharacter);
        this.buffer.append(')');
        this.buffer.append(strSplitCharacter);

    }

    this.buffer.append(" -> "); //$NON-NLS-1$
    node.getBody().accept(this);
    this.buffer.append(strSplitCharacter);
    return false;
}