Пример #1
0
  public static ColumnFilter getFilter(Repository rep, int nodeNum, ObjectId id_step)
      throws KettleException {
    String alias = rep.getStepAttributeString(id_step, nodeNum, "cf_alias");

    ColumnFilter returnVal = new ColumnFilter(alias);
    String type = rep.getStepAttributeString(id_step, nodeNum, "cf_type");
    returnVal.setFieldType(type);
    String comp = rep.getStepAttributeString(id_step, nodeNum, "cf_comparison_opp");
    returnVal.setComparisonOperator(stringToOpp(comp));
    returnVal.setSignedComparison(rep.getStepAttributeBoolean(id_step, nodeNum, "cf_signed_comp"));
    String constant = rep.getStepAttributeString(id_step, nodeNum, "cf_constant");
    returnVal.setConstant(constant);
    String format = rep.getStepAttributeString(id_step, nodeNum, "cf_format");
    returnVal.setFormat(format);

    return returnVal;
  }
Пример #2
0
  public static ColumnFilter getFilter(Node filterNode) {
    String alias = XMLHandler.getTagValue(filterNode, "alias");

    ColumnFilter returnVal = new ColumnFilter(alias);
    String type = XMLHandler.getTagValue(filterNode, "type");
    returnVal.setFieldType(type);
    String comp = XMLHandler.getTagValue(filterNode, "comparison_opp");
    returnVal.setComparisonOperator(stringToOpp(comp));
    String signed = XMLHandler.getTagValue(filterNode, "signed_comp");
    returnVal.setSignedComparison(signed.equalsIgnoreCase("Y"));
    String constant = XMLHandler.getTagValue(filterNode, "constant");
    returnVal.setConstant(constant);
    String format = XMLHandler.getTagValue(filterNode, "format");
    returnVal.setFormat(format);

    return returnVal;
  }