use of org.apache.synapse.commons.evaluators.Condition in project wso2-synapse by wso2.
the class ConditionFactory method createCondition.
public Condition createCondition(OMElement ruleElement) throws EvaluatorException {
Condition r = new Condition();
OMAttribute priorityAtt = ruleElement.getAttribute(new QName(EvaluatorConstants.PRIORITY));
if (priorityAtt != null) {
int p = Integer.parseInt(priorityAtt.getAttributeValue());
r.setPriority(p);
}
OMElement ce = ruleElement.getFirstElement();
EvaluatorFactory ef = EvaluatorFactoryFinder.getInstance().findEvaluatorFactory(ce.getLocalName());
if (ef == null) {
handleException("Invalid configuration element: " + ce.getLocalName());
return null;
}
Evaluator evaluator = ef.create(ce);
r.setEvaluator(evaluator);
return r;
}
Aggregations