Exemple #1
0
  @Override
  public Element encode(StepMetaInterface stepMetaInterface) throws Exception {
    CheckSumMeta checkSumMeta = (CheckSumMeta) stepMetaInterface;
    Document doc = mxUtils.createDocument();
    Element e = doc.createElement(PropsUI.TRANS_STEP_NAME);

    e.setAttribute("checkSumType", String.valueOf(checkSumMeta.getTypeByDesc()));
    e.setAttribute("resultType", String.valueOf(checkSumMeta.getResultType()));
    e.setAttribute("resultfieldName", checkSumMeta.getResultFieldName());
    e.setAttribute("compatibilityMode", String.valueOf(checkSumMeta.isCompatibilityMode()));

    JSONArray jsonArray = new JSONArray();
    String[] fieldName = checkSumMeta.getFieldName();
    for (int j = 0; j < fieldName.length; j++) {
      JSONObject jsonObject = new JSONObject();
      jsonObject.put("name", fieldName[j]);
      jsonArray.add(jsonObject);
    }

    e.setAttribute("fields", jsonArray.toString());

    return e;
  }