Package org.springframework.binding.expression

Examples of org.springframework.binding.expression.PropertyNotFoundException


    try {
      StandardEvaluationContext evaluationContext = createEvaluationContext(rootObject);
      expression.setValue(evaluationContext, value);
    } catch (SpelEvaluationException e) {
      if (e.getMessageCode().equals(SpelMessage.PROPERTY_OR_FIELD_NOT_WRITABLE)) {
        throw new PropertyNotFoundException(rootObject.getClass(), getExpressionString(), e);
      }
      if (e.getMessageCode().equals(SpelMessage.EXCEPTION_DURING_PROPERTY_WRITE)) {
        throw new ValueCoercionException(rootObject.getClass(), getExpressionString(), value, expectedType, e);
      }
      throw new EvaluationException(rootObject.getClass(), getExpressionString(),
View Full Code Here


              + "' spelled correctly?");
        }
      }
      return result;
    } catch (javax.el.PropertyNotFoundException e) {
      throw new PropertyNotFoundException(context.getClass(), getExpressionString(), e);
    } catch (ELException e) {
      throw new EvaluationException(context.getClass(), getExpressionString(),
          "An ELException occurred getting the value for expression '" + getExpressionString()
              + "' on context [" + context.getClass() + "]", e);
    }
View Full Code Here

        throw new EvaluationException(context.getClass(), getExpressionString(), "The expression '"
            + getExpressionString() + "' did not resolve... is the base variable ''" + getBaseVariable()
            + "' spelled correctly?");
      }
    } catch (javax.el.PropertyNotFoundException e) {
      throw new PropertyNotFoundException(context.getClass(), getExpressionString(), e);
    } catch (ELException e) {
      throw new EvaluationException(context.getClass(), getExpressionString(),
          "An ELException occurred setting the value of expression '" + getExpressionString()
              + "' on context [" + context.getClass() + "] to [" + value + "]", e);
    }
View Full Code Here

  public Class<?> getValueType(Object context) {
    ELContext ctx = elContextFactory.getELContext(context);
    try {
      return valueExpression.getType(ctx);
    } catch (javax.el.PropertyNotFoundException e) {
      throw new PropertyNotFoundException(context.getClass(), getExpressionString(), e);
    } catch (ELException e) {
      throw new EvaluationException(context.getClass(), getExpressionString(),
          "An ELException occurred getting the value type for expression '" + getExpressionString()
              + "' on context [" + context.getClass() + "]", e);
    }
View Full Code Here

  public Object getValue(Object rootObject) throws EvaluationException {
    try {
      return expression.getValue(createEvaluationContext(rootObject), expectedType);
    } catch (SpelEvaluationException e) {
      if (e.getMessageCode().equals(SpelMessage.PROPERTY_OR_FIELD_NOT_READABLE)) {
        throw new PropertyNotFoundException(rootObject.getClass(), getExpressionString(), e);
      }
      if (e.getMessageCode().equals(SpelMessage.TYPE_CONVERSION_ERROR)) {
        throw new ValueCoercionException(rootObject.getClass(), getExpressionString(), null, expectedType, e);
      }
      throw new EvaluationException(rootObject.getClass(), expression.getExpressionString(),
View Full Code Here

      BeanWrapperImpl beanWrapper = new BeanWrapperImpl(context);
      beanWrapper.setAutoGrowNestedPaths(autoGrowNestedPaths);
      beanWrapper.setAutoGrowCollectionLimit(autoGrowCollectionLimit);
      return beanWrapper.getPropertyValue(expression);
    } catch (NotReadablePropertyException e) {
      throw new PropertyNotFoundException(context.getClass(), expression, e);
    } catch (BeansException e) {
      throw new EvaluationException(context.getClass(), getExpressionString(),
          "A BeansException occurred getting the value for expression '" + getExpressionString()
              + "' on context [" + context.getClass() + "]", e);
    }
View Full Code Here

      beanWrapper.setAutoGrowNestedPaths(autoGrowNestedPaths);
      beanWrapper.setAutoGrowCollectionLimit(autoGrowCollectionLimit);
      beanWrapper.setConversionService(conversionService.getDelegateConversionService());
      beanWrapper.setPropertyValue(expression, value);
    } catch (NotWritablePropertyException e) {
      throw new PropertyNotFoundException(context.getClass(), expression, e);
    } catch (TypeMismatchException e) {
      throw new ValueCoercionException(context.getClass(), expression, value, e.getRequiredType(), e);
    } catch (BeansException e) {
      throw new EvaluationException(context.getClass(), getExpressionString(),
          "A BeansException occurred setting the value of expression '" + getExpressionString()
View Full Code Here

  public Class<?> getValueType(Object context) {
    try {
      BeanWrapperImpl beanWrapper = new BeanWrapperImpl(context);
      return beanWrapper.getPropertyType(expression);
    } catch (NotReadablePropertyException e) {
      throw new PropertyNotFoundException(context.getClass(), expression, e);
    } catch (BeansException e) {
      throw new EvaluationException(context.getClass(), getExpressionString(),
          "An BeansException occurred getting the value type for expression '" + getExpressionString()
              + "' on context [" + context.getClass() + "]", e);
    }
View Full Code Here

    try {
      Map evaluationContext = Ognl.addDefaultContext(context, getVariables(context));
      Ognl.setTypeConverter(evaluationContext, createTypeConverter());
      return Ognl.getValue(expression, evaluationContext, context, expectedResultType);
    } catch (NoSuchPropertyException e) {
      throw new PropertyNotFoundException(context.getClass(), getExpressionString(), e);
    } catch (OgnlException e) {
      if (e.getReason() instanceof ValueCoercionException) {
        throw (ValueCoercionException) e.getReason();
      } else {
        throw new EvaluationException(context.getClass(), getExpressionString(),
View Full Code Here

    try {
      Map evaluationContext = Ognl.addDefaultContext(context, getVariables(context));
      Ognl.setTypeConverter(evaluationContext, createTypeConverter());
      Ognl.setValue(expression, evaluationContext, context, value);
    } catch (NoSuchPropertyException e) {
      throw new PropertyNotFoundException(context.getClass(), getExpressionString(), e);
    } catch (OgnlException e) {
      if (e.getReason() instanceof ValueCoercionException) {
        throw (ValueCoercionException) e.getReason();
      } else {
        throw new EvaluationException(context.getClass(), getExpressionString(),
View Full Code Here

TOP

Related Classes of org.springframework.binding.expression.PropertyNotFoundException

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.