Examples of addStatement()


Examples of org.apache.whirr.service.jclouds.StatementBuilder.addStatement()

    Map<InstanceTemplate, ClusterActionEvent> eventMap = Maps.newHashMap();
    Cluster newCluster = cluster;
    for (InstanceTemplate instanceTemplate : clusterSpec.getInstanceTemplates()) {
      StatementBuilder statementBuilder = new StatementBuilder();
      statementBuilder.addStatement(Statements.call("installRunUrl"));
      ClusterActionEvent event = new ClusterActionEvent(getAction(),
          clusterSpec, newCluster, statementBuilder);
      eventMap.put(instanceTemplate, event);
      for (String role : instanceTemplate.getRoles()) {
        ClusterActionHandler handler = handlerMap.get(role);
View Full Code Here

Examples of org.codehaus.groovy.ast.stmt.BlockStatement.addStatement()

            VariableExpression oldValue = new VariableExpression("$oldValue");
            VariableExpression newValue = new VariableExpression("$newValue");
            BlockStatement block = new BlockStatement();

            // create a local variable to hold the old value from the getter
            block.addStatement(new ExpressionStatement(
                new DeclarationExpression(oldValue,
                    Token.newSymbol(Types.EQUALS, 0, 0),
                    new MethodCallExpression(VariableExpression.THIS_EXPRESSION, getterName, ArgumentListExpression.EMPTY_ARGUMENTS))));

            // call the existing block, which will presumably set the value properly
View Full Code Here

Examples of org.codehaus.groovy.ast.stmt.Statement.addStatement()

                    args.add(new VariableExpression(parameter.getName()));
                }
            }
            cce = new ConstructorCallExpression(ClassNode.SUPER, new ArgumentListExpression(args));
            BlockStatement code = new BlockStatement();
            code.addStatement(new ExpressionStatement(cce));
            Statement oldCode = ctor.getCode();
            if (oldCode != null) code.addStatement(oldCode);
            ctor.setCode(code);
        }
    }
View Full Code Here

Examples of org.eclipse.cdt.core.dom.ast.IASTCompoundStatement.addStatement()

  private IASTStatement convertSwitchStatement(final SwitchStatement switchStatement) {
    final ExpressionInfo controller = new ExpressionInfo(switchStatement.getExpression(), typeDeclaration, compilationUnitInfo);
    final IASTCompoundStatement body = f.newCompoundStatement();
    for (final Object statementObject : switchStatement.statements()) {
      final StatementInfo statementInfo = new StatementInfo((Statement) statementObject, typeDeclaration, compilationUnitInfo);
      body.addStatement(statementInfo.getStatement());
    }
    return f.newSwitchStatement(controller.getExpression(), body);
  }

  private IASTStatement convertDoStatement(final DoStatement doStatement) {
View Full Code Here

Examples of org.eclipse.dltk.ast.declarations.ModuleDeclaration.addStatement()

      if (node instanceof ModuleDeclaration) {
        ModuleDeclaration unit = (ModuleDeclaration) node;
        List exprs = new ArrayList();
        exprs.add(new SimpleReference(position, position, ""));
        RutaEmptyCompleteStatement statement = new RutaEmptyCompleteStatement(exprs);
        unit.addStatement(statement);
        this.parseBlockStatements(statement, unit, position);
      } else if (node instanceof MethodDeclaration) {
        // empty keyword like completion.
        MethodDeclaration method = (MethodDeclaration) node;
        List exprs = new ArrayList();
View Full Code Here

Examples of org.eclipse.dltk.ast.statements.Block.addStatement()

      block = (Block) node;
    }
    if (block == null) {
      return;
    }
    block.addStatement(s);
    block.setEnd(s.sourceEnd());
  }
}
View Full Code Here

Examples of org.jboss.errai.codegen.BlockStatement.addStatement()

      if (getJavaMember(attr) instanceof Field) {

        BlockStatement methodBody = new BlockStatement();

        // Now unwrap in case it's a WrappedPortable
        methodBody.addStatement(
            If.instanceOf(Stmt.loadVariable(entityInstanceParam), WrappedPortable.class)
                .append(
                    Stmt.loadVariable(entityInstanceParam).assignValue(
                        Stmt.castTo(WrappedPortable.class, Stmt.loadVariable(entityInstanceParam)).invoke("unwrap")))
                .finish());
View Full Code Here

Examples of org.jclouds.scriptbuilder.ScriptBuilder.addStatement()

      exec("chmod 755 /usr/bin/runurl"));

    // Note that the runurl scripts should be checked in to whirr/scripts/
    String runUrlBase = System.getProperty("whirr.runurl.base", "http://whirr.s3.amazonaws.com/");
    for (String url : urls) {
      scriptBuilder.addStatement(exec("runurl " + new URL(new URL(runUrlBase), url)));
    }

    return scriptBuilder.build(org.jclouds.scriptbuilder.domain.OsFamily.UNIX)
      .getBytes();
  }
View Full Code Here

Examples of org.mozilla.javascript.ast.Block.addStatement()

  @Override
  public AstNode block(Iterable<AstNode> statements) {
    Block block = new Block();
    for (AstNode stmt : statements) {
      if (stmt != null) {
        block.addStatement(stmt);
      }
    }
    return block;
  }
View Full Code Here

Examples of org.mozilla.javascript.ast.SwitchCase.addStatement()

  public AstNode caseStatement(AstNode expression, Iterable<AstNode> statements) {
    SwitchCase s = new SwitchCase();
    s.setExpression(expression);
    for (AstNode stmt : statements) {
      if (stmt != null) {
        s.addStatement(stmt);
      }
    }
    return s;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.