Package org.mvel2.integration.impl

Examples of org.mvel2.integration.impl.DefaultLocalVariableResolverFactory


    return list;
  }

  public Object getReducedValue(Object ctx, Object thisValue, VariableResolverFactory factory) {
    ItemResolverFactory.ItemResolver itemR = new ItemResolverFactory.ItemResolver("$");
    ItemResolverFactory itemFactory = new ItemResolverFactory(itemR, new DefaultLocalVariableResolverFactory(factory));

    List list;

    if (constraintEx != null) {
      Object x = dataEx.getValue(ctx, thisValue, factory);
View Full Code Here


            java.util.List.class);

    ParserContext context = new ParserContext(imports, null, "testfile");
    ExpressionCompiler compiler = new ExpressionCompiler("List list = new ArrayList(); return (list == empty)");
    assertTrue((Boolean) executeExpression(compiler.compile(context),
            new DefaultLocalVariableResolverFactory()));
  }
View Full Code Here

    compiler = new ExpressionCompiler("map = new HashMap(); map.size()");
    s = compiler.compile(ctx);

    assertEquals(0,
            executeExpression(s,
                    new DefaultLocalVariableResolverFactory()));
  }
View Full Code Here

    ExpressionCompiler compiler = new ExpressionCompiler(expression);
    Serializable s = compiler.compile();

    assertEquals(0,
            executeExpression(s,
                    new DefaultLocalVariableResolverFactory()));

    assertEquals(0,
            MVEL.eval(expression,
                    new HashMap()));
  }
View Full Code Here

    Cheesery p1 = new Cheesery("bobbo",
            new Cheese("cheddar",
                    15));
    Cheesery p2 = (Cheesery) executeExpression(compiler.compile(ctx),
            new DefaultLocalVariableResolverFactory());

    assertEquals(p1,
            p2);
  }
View Full Code Here

    ExpressionCompiler compiler = new ExpressionCompiler("new Cheesery(\"bobbo\", null)");

    Cheesery p1 = new Cheesery("bobbo",
            null);
    Cheesery p2 = (Cheesery) executeExpression(compiler.compile(ctx),
            new DefaultLocalVariableResolverFactory());

    assertEquals(p1,
            p2);
  }
View Full Code Here

            new ExpressionCompiler("message='Hello';b=7;\nSystem.out.println(message + ';' + b);\n"
                    + "System.out.println(message + ';' + b); b");

    assertEquals(7,
            executeExpression(compiler.compile(ctx),
                    new DefaultLocalVariableResolverFactory()));
  }
View Full Code Here

                                 final Object invokerLookup,
                                 final BaseDescr descrLookup) {
        TemplateRegistry registry = getRuleTemplateRegistry();

        context.getMethods().add(
                TemplateRuntime.execute(registry.getNamedTemplate(ruleTemplate), null, new MapVariableResolverFactory(vars), registry)
        );

        registry = getInvokerTemplateRegistry();
        final String invokerClassName = context.getPkg().getName() + "." + context.getProcessDescr().getClassName() + StringUtils.ucFirst(className) + "Invoker";

        context.getInvokers().put(invokerClassName,
                TemplateRuntime.execute(registry.getNamedTemplate(invokerTemplate), null, new MapVariableResolverFactory(vars), registry)
        );

        context.getInvokerLookups().put(invokerClassName,
                invokerLookup);
        context.getDescrLookups().put(invokerClassName,
View Full Code Here

    public static void generateMethodTemplate(final String ruleTemplate, final RuleBuildContext context, final Map vars) {
        TemplateRegistry registry = getRuleTemplateRegistry(context.getPackageBuilder().getRootClassLoader());

        context.addMethod((String) TemplateRuntime.execute( registry.getNamedTemplate(ruleTemplate),
                                                            null,
                                                            new MapVariableResolverFactory(vars),
                                                            registry) );
    }
View Full Code Here

        final String invokerClassName = context.getPkg().getName() + "." + context.getRuleDescr().getClassName() + StringUtils.ucFirst( className ) + "Invoker";

        context.getInvokers().put( invokerClassName,
                                   (String) TemplateRuntime.execute( registry.getNamedTemplate( invokerTemplate ),
                                                                     null,
                                                                     new MapVariableResolverFactory( vars ),
                                                                     registry ) );

        context.getInvokerLookups().put( invokerClassName,
                                             invokerLookup );
        context.getDescrLookups().put( invokerClassName,
View Full Code Here

TOP

Related Classes of org.mvel2.integration.impl.DefaultLocalVariableResolverFactory

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.