Package org.apache.synapse.commons.evaluators

Examples of org.apache.synapse.commons.evaluators.Condition


*/
public class ConditionFactory {
    private Log log = LogFactory.getLog(ConditionFactory.class);

    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;
    }
View Full Code Here

TOP

Related Classes of org.apache.synapse.commons.evaluators.Condition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.