use of org.apache.synapse.commons.evaluators.NotEvaluator in project wso2-synapse by wso2.
the class NotFactory method create.
public Evaluator create(OMElement e) throws EvaluatorException {
NotEvaluator not = new NotEvaluator();
OMElement ce = e.getFirstElement();
EvaluatorFactory ef = EvaluatorFactoryFinder.getInstance().findEvaluatorFactory(ce.getLocalName());
if (ef == null) {
handleException("Invalid configuration element: " + ce.getLocalName());
return null;
}
Evaluator evaluator = ef.create(ce);
not.setEvaluator(evaluator);
return not;
}
use of org.apache.synapse.commons.evaluators.NotEvaluator in project wso2-synapse by wso2.
the class NotSerializer method serialize.
public OMElement serialize(OMElement parent, Evaluator evaluator) throws EvaluatorException {
if (!(evaluator instanceof NotEvaluator)) {
throw new IllegalArgumentException("Evalutor should be a NotEvalutor");
}
NotEvaluator notEvaluator = (NotEvaluator) evaluator;
OMElement notElement = fac.createOMElement(EvaluatorConstants.NOT, EvaluatorConstants.SYNAPSE_NAMESPACE, EvaluatorConstants.EMPTY_PREFIX);
serializeChild(notElement, notEvaluator.getEvaluator());
if (parent != null) {
parent.addChild(notElement);
}
return notElement;
}
Aggregations