Package de.odysseus.el.tree

Examples of de.odysseus.el.tree.Tree.bind()


    Tree tree = null;
    Bindings bindings = null;
    MethodInfo info = null;

    tree = parse("${bad}");
    bindings = tree.bind(null, context.getVariableMapper());
    try { getNode(tree).getMethodInfo(bindings, context, long.class, new Class[0]); fail(); } catch (ELException e) {}
   
    tree = parse("${var_method_1}");
    bindings = tree.bind(null, context.getVariableMapper());
    info = getNode(tree).getMethodInfo(bindings, context, long.class, new Class[0]);
View Full Code Here


    tree = parse("${bad}");
    bindings = tree.bind(null, context.getVariableMapper());
    try { getNode(tree).getMethodInfo(bindings, context, long.class, new Class[0]); fail(); } catch (ELException e) {}
   
    tree = parse("${var_method_1}");
    bindings = tree.bind(null, context.getVariableMapper());
    info = getNode(tree).getMethodInfo(bindings, context, long.class, new Class[0]);
    assertEquals("method_1", info.getName());
    assertTrue(Arrays.equals(new Class[0], info.getParamTypes()));
    assertEquals(long.class, info.getReturnType());
   
View Full Code Here

    assertEquals("method_1", info.getName());
    assertTrue(Arrays.equals(new Class[0], info.getParamTypes()));
    assertEquals(long.class, info.getReturnType());
   
    tree = parse("${property_method_1}");
    bindings = tree.bind(null, context.getVariableMapper());
    info = getNode(tree).getMethodInfo(bindings, context, long.class, new Class[0]);
    assertEquals("method_1", info.getName());
    assertTrue(Arrays.equals(new Class[0], info.getParamTypes()));
    assertEquals(long.class, info.getReturnType());
View Full Code Here

    super();

    Tree tree = store.get(expr);

    this.builder = store.getBuilder();
    this.bindings = tree.bind(functions, variables, converter);
    this.expr = expr;
    this.type = returnType == void.class ? null : returnType;
    this.types = paramTypes;
    this.node = tree.getRoot();
    this.deferred = tree.isDeferred();
View Full Code Here

  public void testVarargs() {
    Builder builder = new Builder(Feature.VARARGS);
    Tree tree = null;

    tree = builder.build("${vararg:f()}");
    assertEquals(foovar(), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), null));

    tree = builder.build("${vararg:f(1)}");
    assertEquals(foovar(1), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), null));

    tree = builder.build("${vararg:f(1,1)}");
View Full Code Here

    tree = builder.build("${vararg:f()}");
    assertEquals(foovar(), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), null));

    tree = builder.build("${vararg:f(1)}");
    assertEquals(foovar(1), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), null));

    tree = builder.build("${vararg:f(1,1)}");
    assertEquals(foovar(1,1), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), null));

    tree = builder.build("${vararg:f(null)}");
View Full Code Here

    tree = builder.build("${vararg:f(1)}");
    assertEquals(foovar(1), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), null));

    tree = builder.build("${vararg:f(1,1)}");
    assertEquals(foovar(1,1), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), null));

    tree = builder.build("${vararg:f(null)}");
    assertEquals(foovar(0), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), null));

    tree = builder.build("${vararg:f(var111)}");
View Full Code Here

    tree = builder.build("${vararg:f(1,1)}");
    assertEquals(foovar(1,1), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), null));

    tree = builder.build("${vararg:f(null)}");
    assertEquals(foovar(0), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), null));

    tree = builder.build("${vararg:f(var111)}");
    assertEquals(foovar(1,1,1), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), context));
  }
View Full Code Here

    tree = builder.build("${vararg:f(null)}");
    assertEquals(foovar(0), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), null));

    tree = builder.build("${vararg:f(var111)}");
    assertEquals(foovar(1,1,1), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), context));
  }

  public void testEval() {
    Tree tree = null;
View Full Code Here

  public void testEval() {
    Tree tree = null;

    tree = parse("${ns:f0()}");
    assertEquals(foo(), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), null));

    tree = parse("${ns:f1(42)}");
    assertEquals(bar(42), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), null));

    tree = parse("${ns:f2(21,21)}");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.