Package org.mule.mvel2.integration.impl

Examples of org.mule.mvel2.integration.impl.MapVariableResolverFactory


    return null;
  }

  public Object getReducedValue(Object ctx, Object thisValue, VariableResolverFactory factory) {
    Object v;
    for (initializer.getValue(ctx, thisValue, factory = new MapVariableResolverFactory(new HashMap<String, Object>(1), factory)); (Boolean) condition.getValue(ctx, thisValue, factory); after.getValue(ctx, thisValue, factory)) {
      v = compiledBlock.getValue(ctx, thisValue, factory);
      if (factory.tiltFlag()) return v;
    }

    return null;
View Full Code Here


    }
  }

  public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) {
    VariableResolverFactory ctxFactory = new MapVariableResolverFactory(new HashMap<String, Object>(), factory);
    while ((Boolean) condition.getValue(ctx, thisValue, factory)) {
      compiledBlock.getValue(ctx, thisValue, ctxFactory);
    }

    return null;
View Full Code Here

    return null;
  }

  public Object getReducedValue(Object ctx, Object thisValue, VariableResolverFactory factory) {
    VariableResolverFactory ctxFactory = new MapVariableResolverFactory(new HashMap<String, Object>(), factory);

    while ((Boolean) condition.getValue(ctx, thisValue, factory)) {
      compiledBlock.getValue(ctx, thisValue, ctxFactory);
    }
    return null;
View Full Code Here

        env.put("$PATH", "/bin:/usr/bin:/sbin:/usr/sbin");
      }

    }

    lvrf = new MapVariableResolverFactory(variables, new MapVariableResolverFactory(env));

  }
View Full Code Here

        assertEquals("JaneJohn", test(s));
    }

    public void testFileBasedEval() {
        assertEquals("Foo::Bar", TemplateRuntime.eval(new File("src/test/java/org/mvel2/tests/templates/templateTest.mv"),
                base, new MapVariableResolverFactory(map), null));
    }
View Full Code Here

        assertTrue(false);
    }

    public void testTemplateFile() {
        String s = (String) TemplateRuntime.eval(new File("src/test/java/org/mvel2/tests/templates/templateIfTest.mv"),
                base, new MapVariableResolverFactory(map), null);

        System.out.println(s);

    }
View Full Code Here

        CompiledTemplate compiledTemplate = TemplateCompiler.compileTemplate(template);

        Map<String, Object> model = new HashMap<String, Object>();
        model.put("foo", foo);

        System.out.println(TemplateRuntime.execute(compiledTemplate, new ParserContext(), new MapVariableResolverFactory(model)));
    }
View Full Code Here

                                                                Collections.EMPTY_LIST ) ) ) );


        String result = (String) TemplateRuntime.execute( reportRegistry.getNamedTemplate( "drl" ),
                                                          null,
                                                          new MapVariableResolverFactory( context ),
                                                          reportRegistry );

        assertEquals("OR AND AND OR", result);
    }
View Full Code Here

    this.function = function;
  }

  @Override
  public Object getReducedValue(Object ctx, Object thisValue, VariableResolverFactory factory) {
    final MapVariableResolverFactory resolverFactory = new MapVariableResolverFactory(new HashMap<String, Object>(), factory);
    function.getCompiledBlock().getValue(ctx, thisValue, resolverFactory);
    return new PrototypalFunctionInstance(function, resolverFactory);
  }
View Full Code Here

  public void testQuickSort() throws IOException {
    Serializable s = MVEL.compileExpression(new String(ParseTools.loadFromFile(new File("samples/scripts/fquicksort.mvel"))));

    HashMap map = new HashMap();
    MapVariableResolverFactory mvrf = new MapVariableResolverFactory(map);

    for (int i = 0; i < 1000000; i++) {
      MVEL.executeExpression(s, mvrf);
      mvrf.clear();
    }

//        for (int x = 0; x < 4; x++) {
//            Serializable s = MVEL.compileSetExpression("tak.bar.name");
//            long time = System.currentTimeMillis();
View Full Code Here

TOP

Related Classes of org.mule.mvel2.integration.impl.MapVariableResolverFactory

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.