Package fit

Examples of fit.Parse


    }
    return cs;
  }

  protected void deleteRowData(PreparedStatement statement, Parse row) {
    Parse cell = row.parts;
    try {
      statement.clearParameters();
      for (int column = 0; column < accessors.length; column++, cell = cell.more) {
        int direction = accessors[column].getDirection();
        if (direction == DbParameterAccessor.INPUT) {
View Full Code Here


      } else {// execute using header row
        executeExpectingException(statement, headerRow);
      }
    } catch (SQLException e) {
      exception(headerRow, e);
      headerRow.parts.last().more = new Parse("td", e.getMessage(), null, null);
      e.printStackTrace();
    } finally {
      DBHelper.closeStatement(statement);
      statement = null;
    }
View Full Code Here

  private void executeStatementForEachRow(Parse rows) {
    CallableStatement statement = null;
    try {
      initParameters(rows.parts);// init parameters from the first row
      statement = buildCommand(procName, accessors);
      Parse row = rows;
      while ((row = row.more) != null) {
        runRow(statement, row);
      }
    } catch (Throwable e) {
      exception(rows.parts, e);
View Full Code Here

      columnBindings[i].adapter = accessors[i];
    }
  }

  private void runRow(CallableStatement statement, Parse row) {
    Parse cell = row.parts;
    try {
      statement.clearParameters();
      // first set input params
      for (int column = 0; column < accessors.length; column++, cell = cell.more) {
        if (accessors[column].getDirection() == DbParameterAccessor.INPUT) {
View Full Code Here

    }
    PreparedStatement statement = null;
    try {
      initParameters(rows.parts);// init parameters from the first row
      statement = buildUpdateCommand();
      Parse row = rows;
      while ((row = row.more) != null) {
        runRow(statement, row);
      }
    } catch (Throwable e) {
      exception(rows.parts, e);
View Full Code Here

    selectAccessors = selectAcc.toArray(new DbParameterAccessor[0]);
    updateAccessors = updateAcc.toArray(new DbParameterAccessor[0]);
  }

  private void runRow(PreparedStatement statement, Parse row) throws Exception {
    Parse cell = row.parts;
    try {
      statement.clearParameters();
      // first set input params
      for (int column = 0; column < columnBindings.length; column++, cell = cell.more) {
        columnBindings[column].doCell(this, cell);
      }
      statement.execute();
    } catch (SQLException sqle) {
      sqle.printStackTrace();
      exception(row, sqle);
      row.parts.last().more = new Parse("td", sqle.getMessage(), null, null);
    } catch (Throwable e) {
      exception(cell, e);
      throw new HasMarkedException(e);
    }
  }
View Full Code Here

    @Override
    public void doRows(Parse rows) {
        beautify(rows.more);
        if(getArgs().length > 0) {
            initializeValues();
            Parse r = rows;
            Parse original = copy(Collections.<String, String>emptyMap(), r.more);
            r.more = null;
            for (Map<String, String> values: variables) {
                Parse copy = copy(values, original, "Scenario: <b>" + values +"</b>");
                fixValue(copy);
                while (r.more != null) {
                    r = r.more;
                }
                r.more = copy;
View Full Code Here

    private void fixValue(Parse parse) {
        int row = -1;
        while(parse != null) {
            row++;
            Parse expectation = parse.parts;
            int column = -1;
            do {
                column++;
                if(expectation != null && expectation.body != null) {
                    expectation.body = fixValue(row, column, expectation.body);
View Full Code Here

    private static Parse copy(Map<String, String> values, Parse original, String comment) {
        if (original == null) {
            return null;
        } else {
            Parse duplicate = new Parse(null, null, null, null);
            duplicate.body = original.body;
            duplicate.end = original.end;
            duplicate.leader = original.leader;
            duplicate.tag = original.tag;
            duplicate.trailer = original.trailer;
View Full Code Here

            return duplicate;
        }
    }

    private static Parse addComment(String comment, Parse duplicate) {
        Parse dupWithComment = new Parse(null, null, null, null);
        dupWithComment.leader = "\n\t\t";
        dupWithComment.tag = "<td colspan=\"500\" style=\"background-color:#8FB28F;\">";
        dupWithComment.body = comment;
        dupWithComment.end = "</td>";
        dupWithComment.trailer = "\n\t";
View Full Code Here

TOP

Related Classes of fit.Parse

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.