// Path: src/main/java/org/wmaop/aop/matcher/MatchResult.java
// public class MatchResult {
// 
// 	public static final MatchResult FALSE = new MatchResult(false, "undefined");
// 	public static final MatchResult TRUE = new MatchResult(true, "undefined");
// 	
// 	private final boolean isMatch;
// 	private final String id;
// 
// 	public MatchResult(boolean result, String id) {
// 		this.id = id;
// 		isMatch = result;
// 	}
// 
// 	public boolean isMatch() {
// 		return isMatch;
// 	}
// 
// 	public String getId() {
// 		return id;
// 	}
// 	
// 	@Override
// 	public String toString() {
// 		return "MatchResult:"+isMatch+" for " + id;
// 	}
// }
// 
// Path: src/main/java/org/wmaop/aop/matcher/Matcher.java
// public interface Matcher<T> {
// 	MatchResult match(T value);
// 
// 	Map<String, Object> toMap();
// }


import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.commons.jexl3.JexlContext;
import org.apache.commons.jexl3.JexlExpression;
import org.apache.commons.jexl3.MapContext;
import org.wmaop.aop.matcher.MatchResult;
import org.wmaop.aop.matcher.Matcher;
import org.wmaop.util.jexl.IDataJexlContext;
import org.wmaop.util.jexl.JexlExpressionFactory;
import com.wm.data.IData;
package org.wmaop.aop.matcher.jexl;




public class JexlIDataMatcher implements Matcher<IData> {

	private final Map<String, JexlExpression> expressions = new LinkedHashMap<>();
	private final String expression;
	
	public JexlIDataMatcher(String sid, String expression) {
		createExpression(sid, expression);
		this.expression = expression;
	}

	public JexlIDataMatcher(Map<String, String> exprs) {
		for (Entry<String, String> expr : exprs.entrySet()) {
			createExpression(expr.getKey(), expr.getValue());
		}
		expression = Arrays.toString(expressions.values().toArray());
	}

	@Override
// Path: src/main/java/org/wmaop/aop/matcher/MatchResult.java
// public class MatchResult {
// 
// 	public static final MatchResult FALSE = new MatchResult(false, "undefined");
// 	public static final MatchResult TRUE = new MatchResult(true, "undefined");
// 	
// 	private final boolean isMatch;
// 	private final String id;
// 
// 	public MatchResult(boolean result, String id) {
// 		this.id = id;
// 		isMatch = result;
// 	}
// 
// 	public boolean isMatch() {
// 		return isMatch;
// 	}
// 
// 	public String getId() {
// 		return id;
// 	}
// 	
// 	@Override
// 	public String toString() {
// 		return "MatchResult:"+isMatch+" for " + id;
// 	}
// }
// 
// Path: src/main/java/org/wmaop/aop/matcher/Matcher.java
// public interface Matcher<T> {
// 	MatchResult match(T value);
// 
// 	Map<String, Object> toMap();
// }


// Path: src/main/java/org/wmaop/aop/matcher/jexl/JexlIDataMatcher.java
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.commons.jexl3.JexlContext;
import org.apache.commons.jexl3.JexlExpression;
import org.apache.commons.jexl3.MapContext;
import org.wmaop.aop.matcher.MatchResult;
import org.wmaop.aop.matcher.Matcher;
import org.wmaop.util.jexl.IDataJexlContext;
import org.wmaop.util.jexl.JexlExpressionFactory;
import com.wm.data.IData;

package org.wmaop.aop.matcher.jexl;




public class JexlIDataMatcher implements Matcher<IData> {

	private final Map<String, JexlExpression> expressions = new LinkedHashMap<>();
	private final String expression;
	
	public JexlIDataMatcher(String sid, String expression) {
		createExpression(sid, expression);
		this.expression = expression;
	}

	public JexlIDataMatcher(Map<String, String> exprs) {
		for (Entry<String, String> expr : exprs.entrySet()) {
			createExpression(expr.getKey(), expr.getValue());
		}
		expression = Arrays.toString(expressions.values().toArray());
	}

	@Override
	public MatchResult match(IData idata) {