Package org.springframework.expression.spel

Examples of org.springframework.expression.spel.ExpressionState$VariableScope


    return ast.isWritable(new ExpressionState(context, toTypedValue(rootObject), configuration));
  }

  public void setValue(EvaluationContext context, Object value) throws EvaluationException {
    Assert.notNull(context, "The EvaluationContext is required");   
    ast.setValue(new ExpressionState(context, configuration), value);
  }
View Full Code Here


    Assert.notNull(context, "The EvaluationContext is required");   
    ast.setValue(new ExpressionState(context, configuration), value);
  }

  public void setValue(Object rootObject, Object value) throws EvaluationException {
    ast.setValue(new ExpressionState(getEvaluationContext(), toTypedValue(rootObject), configuration), value);
  }
View Full Code Here

    ast.setValue(new ExpressionState(getEvaluationContext(), toTypedValue(rootObject), configuration), value);
  }
 
  public void setValue(EvaluationContext context, Object rootObject, Object value) throws EvaluationException {
    Assert.notNull(context, "The EvaluationContext is required");   
    ast.setValue(new ExpressionState(context, toTypedValue(rootObject), configuration), value);
  }
View Full Code Here

    new OpPlus(-1);
  }

  @Test(expected = SpelEvaluationException.class)
  public void test_unaryPlusWithStringLiteral() {
    ExpressionState expressionState = new ExpressionState(new StandardEvaluationContext());

    StringLiteral str = new StringLiteral("word", -1, "word");

    OpPlus o = new OpPlus(-1, str);
    o.getValueInternal(expressionState);
View Full Code Here

    o.getValueInternal(expressionState);
  }

  @Test
  public void test_unaryPlusWithNumberOperand() {
    ExpressionState expressionState = new ExpressionState(new StandardEvaluationContext());

    {
      RealLiteral realLiteral = new RealLiteral("123.00", -1, 123.0);
      OpPlus o = new OpPlus(-1, realLiteral);
      TypedValue value = o.getValueInternal(expressionState);
View Full Code Here

    }
  }

  @Test
  public void test_binaryPlusWithNumberOperands() {
    ExpressionState expressionState = new ExpressionState(new StandardEvaluationContext());

    {
      RealLiteral n1 = new RealLiteral("123.00", -1, 123.0);
      RealLiteral n2 = new RealLiteral("456.00", -1, 456.0);
      OpPlus o = new OpPlus(-1, n1, n2);
View Full Code Here

    }
  }

  @Test
  public void test_binaryPlusWithStringOperands() {
    ExpressionState expressionState = new ExpressionState(new StandardEvaluationContext());

    StringLiteral n1 = new StringLiteral("\"foo\"", -1, "\"foo\"");
    StringLiteral n2 = new StringLiteral("\"bar\"", -1, "\"bar\"");
    OpPlus o = new OpPlus(-1, n1, n2);
    TypedValue value = o.getValueInternal(expressionState);
View Full Code Here

    assertEquals("foobar", value.getValue());
  }

  @Test
  public void test_binaryPlusWithLeftStringOperand() {
    ExpressionState expressionState = new ExpressionState(new StandardEvaluationContext());

    StringLiteral n1 = new StringLiteral("\"number is \"", -1, "\"number is \"");
    LongLiteral n2 = new LongLiteral("123", -1, 123);
    OpPlus o = new OpPlus(-1, n1, n2);
    TypedValue value = o.getValueInternal(expressionState);
View Full Code Here

    assertEquals("number is 123", value.getValue());
  }

  @Test
  public void test_binaryPlusWithRightStringOperand() {
    ExpressionState expressionState = new ExpressionState(new StandardEvaluationContext());

    LongLiteral n1 = new LongLiteral("123", -1, 123);
    StringLiteral n2 = new StringLiteral("\" is a number\"", -1, "\" is a number\"");
    OpPlus o = new OpPlus(-1, n1, n2);
    TypedValue value = o.getValueInternal(expressionState);
View Full Code Here

  }

  @Test
  public void test_binaryPlusWithTime_ToString() {

    ExpressionState expressionState = new ExpressionState(new StandardEvaluationContext());

    Time time = new Time(new Date().getTime());

    VariableReference var = new VariableReference("timeVar", -1);
    var.setValue(expressionState, time);
View Full Code Here

TOP

Related Classes of org.springframework.expression.spel.ExpressionState$VariableScope

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.