Examples of ExpressionNode


Examples of org.ff4j.strategy.el.ExpressionNode

     * @param expression
     * @param state
     * @param expected
     */
    private void assertNode(String expression, Map<String, Boolean> state, boolean expected) {
        ExpressionNode n = ExpressionParser.parseExpression(expression);
        Assert.assertEquals(expected, n.evalue(state));
    }
View Full Code Here

Examples of org.formulacompiler.compiler.internal.expressions.ExpressionNode

   * Rewrites {@code LOOKUP( x, xs, ys [,type] )} to {@code INDEX( ys, MATCH( x, xs [,type] ))}.
   */
  private ExpressionNode rewriteVectorLookup( ExpressionNodeForFunction _fun )
  {
    // LATER Don't rewrite when over large repeating sections.
    final ExpressionNode x, xs, ys, match;
    x = _fun.argument( 0 );
    xs = _fun.argument( 1 );
    ys = _fun.argument( 2 );
    if (_fun.cardinality() >= 4) {
      final ExpressionNode type = _fun.argument( 3 );
      match = fun( INTERNAL_MATCH_INT, x, xs, type );
    }
    else {
      match = fun( INTERNAL_MATCH_INT, x, xs );
    }
View Full Code Here

Examples of org.jitterbit.logic.expressiontree.ExpressionNode

    }   
  }

    @Override
  public void swapOperands() {
    ExpressionNode temp = leftOperand;
    leftOperand = rightOperand;
    rightOperand = temp;
  }
View Full Code Here

Examples of org.pirkaengine.core.template.ExpressionNode

public class XhtmlTemplateTest {

    @Test
    public void createViewModel_simple() {
        XhtmlTemplate template = new XhtmlTemplate("test");
        template.stack(new ExpressionNode("foo"));
        Map<String, Object> expected = new HashMap<String, Object>();
        expected.put("foo", XhtmlTemplate.NULL_VALUE);
        Assert.assertEquals(expected, template.createViewModel());
    }
View Full Code Here

Examples of org.pirkaengine.core.template.ExpressionNode

    }

    @Test
    public void createViewModel_2_expressions() {
        XhtmlTemplate template = new XhtmlTemplate("test");
        template.stack(new ExpressionNode("foo"));
        template.stack(new ExpressionNode("bar"));
        Map<String, Object> expected = new HashMap<String, Object>();
        expected.put("foo", XhtmlTemplate.NULL_VALUE);
        expected.put("bar", XhtmlTemplate.NULL_VALUE);
        Assert.assertEquals(expected, template.createViewModel());
    }
View Full Code Here

Examples of org.pirkaengine.core.template.ExpressionNode

    }

    @Test
    public void createViewModel_nest_case() {
        XhtmlTemplate template = new XhtmlTemplate("test");
        template.stack(new ExpressionNode("foo.bar"));
        Map<String, Object> expected = new HashMap<String, Object>();
        Map<String, Object> foo = new HashMap<String, Object>();
        foo.put("bar", XhtmlTemplate.NULL_VALUE);
        expected.put("foo", foo);
        Assert.assertEquals(expected, template.createViewModel());
View Full Code Here

Examples of org.pirkaengine.core.template.ExpressionNode

    }

    @Test
    public void createViewModel_composite_case() {
        XhtmlTemplate template = new XhtmlTemplate("test");
        template.stack(new ExpressionNode("foo.bar"));
        template.stack(new ExpressionNode("poo"));
        Map<String, Object> expected = new HashMap<String, Object>();
        Map<String, Object> foo = new HashMap<String, Object>();
        foo.put("bar", XhtmlTemplate.NULL_VALUE);
        expected.put("foo", foo);
        expected.put("poo", XhtmlTemplate.NULL_VALUE);
View Full Code Here

Examples of org.pirkaengine.core.template.ExpressionNode

    @Test
    public void createViewModel_array_simple() {
        XhtmlTemplate template = new XhtmlTemplate("test");
        StartTagNode start = new StartTagNode("li", "prk:for", "item in items");
        EndTagNode end = new EndTagNode("li");
        ExpressionNode node = new ExpressionNode("item");
        template.stack(new LoopNode(start, end, new Node[] { node }));

        Map<String, Object> expected = new HashMap<String, Object>();
        expected.put("items", new ArrayList<Map<String, Object>>());
        Assert.assertEquals(expected, template.createViewModel());
View Full Code Here

Examples of org.pirkaengine.core.template.ExpressionNode

    @Test
    public void createViewModel_array_with_obj() {
        XhtmlTemplate template = new XhtmlTemplate("test");
        StartTagNode start = new StartTagNode("li", "prk:for", "item in items");
        EndTagNode end = new EndTagNode("li");
        ExpressionNode node = new ExpressionNode("item.name");
        template.stack(new LoopNode(start, end, new Node[] { node }));

        Map<String, Object> expected = new HashMap<String, Object>();
        expected.put("items", new ArrayList<Map<String, Object>>());
        Assert.assertEquals(expected, template.createViewModel());
View Full Code Here

Examples of org.pirkaengine.core.template.ExpressionNode

    @Test
    public void createViewModel() {
        XhtmlTemplate template = new XhtmlTemplate("test");
        StartTagNode start = new StartTagNode("li", "prk:for", "item in items");
        EndTagNode end = new EndTagNode("li");
        ExpressionNode node1 = new ExpressionNode("item.name");
        ExpressionNode node2 = new ExpressionNode("item.price");
        template.stack(new LoopNode(start, end, new Node[] { node1, node2 }));
        template.stack(new ExpressionNode("foo.bar"));
        template.stack(new ExpressionNode("poo"));

        Map<String, Object> expected = new HashMap<String, Object>();
        expected.put("items", new ArrayList<Map<String, Object>>());
        Map<String, Object> foo = new HashMap<String, Object>();
        foo.put("bar", XhtmlTemplate.NULL_VALUE);
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.