Package org.araneaframework.backend.list.memorybased.expression.variable

Examples of org.araneaframework.backend.list.memorybased.expression.variable.VariableExpression


   
    if (startValue == null && endValue == null) {
      return new AlwaysTrueExpression();
    }
   
    Expression columnExpr = new VariableExpression(this.columnId);
    Expression startValueExpr = startValue != null ? new ValueExpression(startValue) : null;
    Expression endValueExpr = endValue != null ? new ValueExpression(endValue) : null;
    return buildAction(columnExpr, startValueExpr, endValueExpr);
  }
View Full Code Here


    Object value = filterInfo.get(this.filterInfoKey);
    boolean isNull = this.filterInfoValue == null ? value == null : this.filterInfoValue.equals(value);
    if (!isNull) {
      return new AlwaysTrueExpression();
    }
    return new IsNullExpression(new VariableExpression(this.columnId));
  }
View Full Code Here

  protected Expression buildLeftOperand(Map filterInfo) {
    if (this.columnId == null) {
      throw new RuntimeException("Column Id must be provided");
    }
    return new VariableExpression(this.columnId);
  }
View Full Code Here

    public boolean isActive(Map filterInfo) {
      return true;
    }
   
    public Expression buildExpression(Map filterInfo) {
      return new VariableExpression(this.id);
    }
View Full Code Here

  protected Expression buildLeftOperand(Map filterInfo) {
    if (this.columnId == null) {
      throw new RuntimeException("Column Id must be provided");
    }
    return new VariableExpression(this.columnId);
  }
View Full Code Here

  }
 
  public Expression buildExpression(Map filterInfo) {
    validate();
   
    Expression startVar = new VariableExpression(this.startColumnId);
    Expression endVar = new VariableExpression(this.endColumnId);
    Expression startVal = new ValueExpression(filterInfo.get(this.startFilterInfoKey));
    Expression endVal = new ValueExpression(filterInfo.get(this.endFilterInfoKey));
    return buildAction(startVar, endVar, startVal, endVal);
  }
View Full Code Here

      .getLogger(SimpleSqlExpressionTest.class);

  public void testSqlExpressionBuilder() throws ExpressionEvaluationException {
    // build expression
    Expression expr = new AndExpression().add(
        new ComparedEqualsExpression(new VariableExpression("name"),
            new ValueExpression("James Bond"), ComparatorFactory
                .getStringComparator(false, true, null))).add(
        new GreaterThanExpression(new VariableExpression("age"),
            new ValueExpression(new Long(25)))).add(
        new EqualsExpression(new VariableExpression("licenseToKill"),
            new ValueExpression(Boolean.TRUE)));

    // evaluate expression in memory
    Object value = expr.evaluate(new VariableResolver() {
      public Object resolve(Variable variable) {
View Full Code Here

  public void testVariableExpression() {
    log.debug("Testing VariableExpression");
    // name
    try {
      new VariableExpression(null).getName();
      fail("VariableExpression's name can't be null");
    } catch (Exception e) {
      // normal
    }
    assertEquals("VariableExpression's name must be 'var1'", "var1",
        new VariableExpression("var1").getName());

    // evaluating
    assertEquals("VariableExpression must return Tom", "Tom",
        new VariableExpression("var").evaluate(new MockVariableResolver("var", "Tom")));
  }
View Full Code Here

TOP

Related Classes of org.araneaframework.backend.list.memorybased.expression.variable.VariableExpression

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.