use of org.apache.synapse.commons.evaluators.Parser in project wso2-synapse by wso2.
the class ListenerContextBuilder method createParser.
private Parser createParser(final OMElement definitions) throws AxisFault {
OMElement conditionsElem = definitions.getFirstChildWithName(new QName(EvaluatorConstants.CONDITIONS));
if (conditionsElem == null) {
handleException("Conditions configuration is mandatory for priority based routing");
}
assert conditionsElem != null;
OMAttribute defPriorityAttr = conditionsElem.getAttribute(new QName(EvaluatorConstants.DEFAULT_PRIORITY));
Parser parser;
if (defPriorityAttr != null) {
parser = new Parser(Integer.parseInt(defPriorityAttr.getAttributeValue()));
} else {
parser = new Parser();
}
try {
parser.init(conditionsElem);
} catch (EvaluatorException e) {
handleException("Invalid " + EvaluatorConstants.CONDITIONS + " configuration for priority based mediation", e);
}
return parser;
}
Aggregations