use of org.mvel2.integration.Interceptor in project mvel by mikebrock.
the class CoreConfidenceTests method testInterceptors.
public void testInterceptors() {
Interceptor testInterceptor = new Interceptor() {
public int doBefore(ASTNode node, VariableResolverFactory factory) {
System.out.println("BEFORE Node: " + node.getName());
return 0;
}
public int doAfter(Object val, ASTNode node, VariableResolverFactory factory) {
System.out.println("AFTER Node: " + node.getName());
return 0;
}
};
Map<String, Interceptor> interceptors = new HashMap<String, Interceptor>();
interceptors.put("test", testInterceptor);
executeExpression(compileExpression("@test System.out.println('MIDDLE');", null, interceptors));
}
Aggregations