Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.ForStatement


     * @param post post-loop expression (optional third part of 'for', <code>null</code> if none)
     * @param block statement body block
     */
    private void addForStatement(String name, Type type, Expression init, Expression test, Expression post,
        BlockBuilder block) {
        ForStatement stmt = m_ast.newForStatement();
        VariableDeclarationFragment declfrag = m_ast.newVariableDeclarationFragment();
        declfrag.setName(m_ast.newSimpleName(name));
        declfrag.setInitializer(init);
        VariableDeclarationExpression varexpr = m_ast.newVariableDeclarationExpression(declfrag);
        varexpr.setType(type);
        stmt.initializers().add(varexpr);
        stmt.setExpression(test);
        if (post != null) {
            stmt.updaters().add(post);
        }
        stmt.setBody(block.getStatement());
        m_block.statements().add(stmt);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.ForStatement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.