/** * @param condition * the condition to set */ @Parameter(name = "condition", required = false) public void setCondition(String condition) { ConditionFactory cf = new ConditionFactory(); this.condition = cf.create(condition); if (condition.isEmpty()) condition = null; }
private String readSubConditions(String ex) { // PRIO 9 boolean run = true; int c = 0; boolean start = false; while (run) { // Bis start gefunden if (!start) { ex = brackets(ex, c); c++; // If all Brackets are removed if (!ex.contains("(")) run = false; } } return ex; }
checkBrackets(ex, "{", "}"); ex = replaceAndCreateExpressions(ex); ex = replaceAndCreateStringExpressions(ex); printDoubleExpressions(); printStringExpressions(); log.debug("Expression: {}", ex); ex = readSubConditions(ex); print("SubConditions", subCond); log.debug("Expression: {}", ex); Condition result = createCondition(t); reset(); return result;
private Condition createCondition(ConditionTree t) { if (t == null) throw new IllegalArgumentException("Bad ConditionTree \n" + t); // t is LEAF if (t.isLeaf()) { if (t.getRoot().contains("null")) return createNullCondition(t.getRoot()); if (t.getRoot().contains("true") || t.getRoot().contains("TRUE") || t.getRoot().contains("false") || t.getRoot().contains("FALSE")) { return createBooleanCondition(t.getRoot()); } // Hier ist die Magic if (t.getRoot().contains(":p10sete_")) return createSetCondition(t.getRoot()); if (t.getRoot().contains(":p10se")) return createStringCondition(t.getRoot()); return createDoubleCondition(t.getRoot()); } // t is no LEAF if (t.getOp().equals("AND")) return new AndCondition(createCondition(t.left), createCondition(t.right)); if (t.getOp().equals("OR")) return new OrCondition(createCondition(t.left), createCondition(t.right)); throw new IllegalArgumentException("Bad ConditionTree \n" + t); }
private Condition createCondition(ConditionTree t) { if (t == null) throw new IllegalArgumentException("Bad ConditionTree \n" + t); if (t.isLeaf()) { if (t.getRoot().contains("null")) return createNullCondition(t.getRoot()); // Hier ist die Magic if (t.getRoot().contains("p10se")) return createStringCondition(t.getRoot()); return createDoubleCondition(t.getRoot()); } if (t.getOp().equals("AND")) return new AndCondition(createCondition(t.left), createCondition(t.right)); if (t.getOp().equals("OR")) return new OrCondition(createCondition(t.left), createCondition(t.right)); throw new IllegalArgumentException("Bad ConditionTree \n" + t); }
throw new IllegalArgumentException("Bad ConditionString" + c); if (exps[0].contains("null")) { Expression<Serializable> ex = buildSerializableExpression(exps[1]); if (ex == null) return new EmptyCondition(c); return new EqualsNullCondition(c, ex); Expression<Serializable> ex = buildSerializableExpression(exps[0]); if (ex == null) return new EmptyCondition(c); throw new IllegalArgumentException("Bad ConditionString" + c); if (exps[0].contains("null")) { Expression<Serializable> ex = buildSerializableExpression(exps[1]); if (ex == null) return new EmptyCondition(c); return new NotEqualsNullCondition(c, ex); Expression<Serializable> ex = buildSerializableExpression(exps[0]); if (ex == null) return new EmptyCondition(c);
if (exps.length != 2) throw new IllegalArgumentException("Bad ConditionString" + c); Expression<String> left = createOrBuildStringExpression(exps[0]); Expression<String> right = createOrBuildStringExpression(exps[1]); return new EqualsStringCondition(left, right); if (exps.length != 2) throw new IllegalArgumentException("Bad ConditionString" + c); Expression<String> left = createOrBuildStringExpression(exps[0]); Expression<String> right = createOrBuildStringExpression(exps[1]); return new NotEqualsStringCondition(left, right); if (exps.length != 2) throw new IllegalArgumentException("Bad ConditionString" + c); Expression<String> left = createOrBuildStringExpression(exps[0]); Expression<String> right = createOrBuildStringExpression(exps[1]); return new EqualsRXCondition(left, right); if (exps.length != 2) throw new IllegalArgumentException("Bad ConditionString" + c); Expression<String> left = createOrBuildStringExpression(exps[0]); Expression<String> right = createOrBuildStringExpression(exps[1]); return new NotEqualsRXCondition(left, right);
if (exps.length != 2) throw new IllegalArgumentException("Bad ConditionString" + c); Expression<Double> left = createOrBuildDoubleExpression(exps[0]); Expression<Double> right = createOrBuildDoubleExpression(exps[1]); return new EqualsDoubleCondition(left, right); if (exps.length != 2) throw new IllegalArgumentException("Bad ConditionString" + c); Expression<Double> left = createOrBuildDoubleExpression(exps[0]); Expression<Double> right = createOrBuildDoubleExpression(exps[1]); return new NotEqualsDoubleCondition(left, right); if (exps.length != 2) throw new IllegalArgumentException("Bad ConditionString" + c); Expression<Double> left = createOrBuildDoubleExpression(exps[0]); Expression<Double> right = createOrBuildDoubleExpression(exps[1]); return new LEDoubleCondition(left, right); if (exps.length != 2) throw new IllegalArgumentException("Bad ConditionString" + c); Expression<Double> left = createOrBuildDoubleExpression(exps[0]); Expression<Double> right = createOrBuildDoubleExpression(exps[1]); return new GEDoubleCondition(left, right); if (exps.length != 2) throw new IllegalArgumentException("Bad ConditionString" + c); Expression<Double> left = createOrBuildDoubleExpression(exps[0]); Expression<Double> right = createOrBuildDoubleExpression(exps[1]); return new GDoubleCondition(left, right);
ex = replaceAndCreateExpressions(ex); ex = replaceAndCreateStringExpressions(ex); printDoubleExpressions(); printStringExpressions(); printSetExpressions(); log.debug("Expression: {}", ex); ex = readSubConditions(ex); print("SubConditions", subCond); log.trace("Expression: {}", ex); Condition result = createCondition(t); reset(); return result;
throw new IllegalArgumentException("Bad ConditionString" + c); if (exps[0].contains("null")) { Expression<Serializable> ex = buildSerializableExpression(exps[1]); if (ex == null) return new EmptyCondition(c); return new EqualsNullCondition(c, ex); Expression<Serializable> ex = buildSerializableExpression(exps[0]); if (ex == null) return new EmptyCondition(c); throw new IllegalArgumentException("Bad ConditionString" + c); if (exps[0].contains("null")) { Expression<Serializable> ex = buildSerializableExpression(exps[1]); if (ex == null) return new EmptyCondition(c); return new NotEqualsNullCondition(c, ex); Expression<Serializable> ex = buildSerializableExpression(exps[0]); if (ex == null) return new EmptyCondition(c);
if (exps.length != 2) throw new IllegalArgumentException("Bad ConditionString" + c); Expression<String> left = createOrBuildStringExpression(exps[0]); Expression<String> right = createOrBuildStringExpression(exps[1]); return new EqualsStringCondition(left, right); if (exps.length != 2) throw new IllegalArgumentException("Bad ConditionString" + c); Expression<String> left = createOrBuildStringExpression(exps[0]); Expression<String> right = createOrBuildStringExpression(exps[1]); return new NotEqualsStringCondition(left, right); if (exps.length != 2) throw new IllegalArgumentException("Bad ConditionString" + c); Expression<String> left = createOrBuildStringExpression(exps[0]); Expression<String> right = createOrBuildStringExpression(exps[1]); return new EqualsRXCondition(left, right); if (exps.length != 2) throw new IllegalArgumentException("Bad ConditionString" + c); Expression<String> left = createOrBuildStringExpression(exps[0]); Expression<String> right = createOrBuildStringExpression(exps[1]); return new NotEqualsRXCondition(left, right);
if (exps.length != 2) throw new IllegalArgumentException("Bad ConditionString" + c); Expression<Double> left = createOrBuildDoubleExpression(exps[0]); Expression<Double> right = createOrBuildDoubleExpression(exps[1]); return new EqualsDoubleCondition(left, right); if (exps.length != 2) throw new IllegalArgumentException("Bad ConditionString" + c); Expression<Double> left = createOrBuildDoubleExpression(exps[0]); Expression<Double> right = createOrBuildDoubleExpression(exps[1]); return new NotEqualsDoubleCondition(left, right); if (exps.length != 2) throw new IllegalArgumentException("Bad ConditionString" + c); Expression<Double> left = createOrBuildDoubleExpression(exps[0]); Expression<Double> right = createOrBuildDoubleExpression(exps[1]); return new LEDoubleCondition(left, right); if (exps.length != 2) throw new IllegalArgumentException("Bad ConditionString" + c); Expression<Double> left = createOrBuildDoubleExpression(exps[0]); Expression<Double> right = createOrBuildDoubleExpression(exps[1]); return new GEDoubleCondition(left, right); if (exps.length != 2) throw new IllegalArgumentException("Bad ConditionString" + c); Expression<Double> left = createOrBuildDoubleExpression(exps[0]); Expression<Double> right = createOrBuildDoubleExpression(exps[1]); return new GDoubleCondition(left, right);
/** * @param condition * the condition to set */ @Parameter(name = "condition", required = false) public void setCondition(String condition) { ConditionFactory cf = new ConditionFactory(); this.condition = cf.create(condition); if (condition.isEmpty()) condition = null; }
private String readSubConditions(String ex) { // PRIO 9 boolean run = true; int c = 0; boolean start = false; while (run) { // Bis start gefunden if (!start) { ex = brackets(ex, c); c++; // If all Brackets are removed if (!ex.contains("(")) run = false; } } return ex; }
/** * @param condition * the condition to set */ @Parameter(name = "condition", required = false, description = "The condition parameter allows to specify a boolean expression that is matched against each item. The processor only processes items matching that expression.") public void setCondition(String condition) { try { ConditionFactory cf = new ConditionFactory(); this.condition = cf.create(condition); if (condition.isEmpty()) this.condition = null; } catch (Exception e) { throw new RuntimeException(e.getMessage()); } }
/** * @param condition * the condition to set */ @Parameter(name = "condition", required = false, description = "The condition parameter allows to specify a boolean expression that is matched against each item. The processor only processes items matching that expression.") public void setCondition(String condition) { try { ConditionFactory cf = new ConditionFactory(); this.condition = cf.create(condition); if (condition.isEmpty()) this.condition = null; } catch (Exception e) { throw new RuntimeException(e.getMessage()); } }
/** * @param condition * the condition to set */ @Parameter(name = "condition", required = false, description = "The condition parameter allows to specify a boolean expression that is matched against each item. The processor only processes items matching that expression.") public void setCondition(String condition) { try { ConditionFactory cf = new ConditionFactory(); this.condition = cf.create(condition); if (condition.isEmpty()) this.condition = null; } catch (Exception e) { throw new RuntimeException(e.getMessage()); } }
/** * @param condition * the condition to set */ @Parameter(name = "condition", required = false, description = "The condition parameter allows to specify a boolean expression that is matched against each item. The processor only processes items matching that expression.") public void setCondition(String condition) { try { ConditionFactory cf = new ConditionFactory(); this.condition = cf.create(condition); if (condition.isEmpty()) this.condition = null; } catch (Exception e) { throw new RuntimeException(e.getMessage()); } }
@Override public void init(ProcessContext ctx) throws Exception { super.init(ctx); localCtx = DataFactory.create(); localProcessContext = new ProcessContextMock2(); expressions = new SerializableExpression[keys.length]; if (keys == null) throw new IllegalArgumentException("Keys are not set!"); for (int i = 0; i < keys.length; i++) { String key = keys[i]; Expression<Serializable> e = null; e = new SerializableExpression("%{" + sourceCtx + "." + key + "}"); if (e != null) expressions[i] = e; } // KeySetConditions... if (conditionString != null && !conditionString.isEmpty()) { String s = conditionString.replace("sourceCtx.key", sourceCtx + ".key"); ConditionFactory cf = new ConditionFactory(); condition = cf.create(s); } }
@Override public void init(ProcessContext ctx) throws Exception { super.init(ctx); localCtx = DataFactory.create(); localProcessContext = new ProcessContextMock2(); expressions = new SerializableExpression[keys.length]; if (keys == null) throw new IllegalArgumentException("Keys are not set!"); for (int i = 0; i < keys.length; i++) { String key = keys[i]; Expression<Serializable> e = null; e = new SerializableExpression("%{" + sourceCtx + "." + key + "}"); if (e != null) expressions[i] = e; } // KeySetConditions... if (conditionString != null && !conditionString.isEmpty()) { String s = conditionString.replace("sourceCtx.key", sourceCtx + ".key"); ConditionFactory cf = new ConditionFactory(); condition = cf.create(s); } }