Examples of ExpressionState


Examples of org.springframework.expression.spel.ExpressionState

  public final Object getValue(ExpressionState expressionState) throws EvaluationException {
    if (expressionState != null) {
      return getValueInternal(expressionState).getValue();
    } else {
      // configuration not set - does that matter?
      return getValue(new ExpressionState(new StandardEvaluationContext()));
    }
  }
View Full Code Here

Examples of org.springframework.expression.spel.ExpressionState


  // implementing Expression
 
  public Object getValue() throws EvaluationException {
    ExpressionState expressionState = new ExpressionState(getEvaluationContext(), configuration);
    return ast.getValue(expressionState);
  }
View Full Code Here

Examples of org.springframework.expression.spel.ExpressionState

    ExpressionState expressionState = new ExpressionState(getEvaluationContext(), configuration);
    return ast.getValue(expressionState);
  }

  public Object getValue(Object rootObject) throws EvaluationException {
    ExpressionState expressionState = new ExpressionState(getEvaluationContext(), toTypedValue(rootObject), configuration);
    return ast.getValue(expressionState);
  }
View Full Code Here

Examples of org.springframework.expression.spel.ExpressionState

    ExpressionState expressionState = new ExpressionState(getEvaluationContext(), toTypedValue(rootObject), configuration);
    return ast.getValue(expressionState);
  }

  public <T> T getValue(Class<T> expectedResultType) throws EvaluationException {
    ExpressionState expressionState = new ExpressionState(getEvaluationContext(), configuration);
    Object result = ast.getValue(expressionState);
    return ExpressionUtils.convert(expressionState.getEvaluationContext(), result, expectedResultType);
  }
View Full Code Here

Examples of org.springframework.expression.spel.ExpressionState

    Object result = ast.getValue(expressionState);
    return ExpressionUtils.convert(expressionState.getEvaluationContext(), result, expectedResultType);
  }

  public <T> T getValue(Object rootObject, Class<T> expectedResultType) throws EvaluationException {
    ExpressionState expressionState = new ExpressionState(getEvaluationContext(), toTypedValue(rootObject), configuration);
    Object result = ast.getValue(expressionState);
    return ExpressionUtils.convert(expressionState.getEvaluationContext(), result, expectedResultType);
  }
View Full Code Here

Examples of org.springframework.expression.spel.ExpressionState

    return ExpressionUtils.convert(expressionState.getEvaluationContext(), result, expectedResultType);
  }

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

Examples of org.springframework.expression.spel.ExpressionState

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

Examples of org.springframework.expression.spel.ExpressionState

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

  @SuppressWarnings("unchecked")
  public <T> T getValue(EvaluationContext context, Class<T> expectedResultType) throws EvaluationException {
    Object result = ast.getValue(new ExpressionState(context, configuration));
    if (result != null && expectedResultType != null) {
      Class<?> resultType = result.getClass();
      if (!expectedResultType.isAssignableFrom(resultType)) {
        // Attempt conversion to the requested type, may throw an exception
        result = context.getTypeConverter().convertValue(result, TypeDescriptor.valueOf(expectedResultType));
View Full Code Here

Examples of org.springframework.expression.spel.ExpressionState

    return (T) result;
  }
 
  @SuppressWarnings("unchecked")
  public <T> T getValue(EvaluationContext context, Object rootObject, Class<T> expectedResultType) throws EvaluationException {
    Object result = ast.getValue(new ExpressionState(context, toTypedValue(rootObject), configuration));
    if (result != null && expectedResultType != null) {
      Class<?> resultType = result.getClass();
      if (!expectedResultType.isAssignableFrom(resultType)) {
        // Attempt conversion to the requested type, may throw an exception
        result = context.getTypeConverter().convertValue(result, TypeDescriptor.valueOf(expectedResultType));
View Full Code Here

Examples of org.springframework.expression.spel.ExpressionState

    return (T) result;
  }


  public Class getValueType() throws EvaluationException {
    return ast.getValueInternal(new ExpressionState(getEvaluationContext(), configuration)).getTypeDescriptor().getType();
  }
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.