public Object getValue(ELContext context) throws NullPointerException, ELException, ValueCoercionException { Object value = targetExpression.getValue(context); return convertValueIfNecessary(value, expectedType, context); }
private Object convertValueIfNecessary(Object value, Class<?> expectedType, Object context) throws ValueCoercionException { if (expectedType == null) { return value; } else { try { return conversionService.executeConversion(value, expectedType); } catch (ConversionException e) { throw new ValueCoercionException(context.getClass(), getExpressionString(), value, expectedType, e); } } }
private ValueExpression parseValueExpression(String expressionString, ParserContext context) throws ELException { ParserELContext elContext = new ParserELContext(); elContext.mapVariables(context.getExpressionVariables(), expressionFactory); ValueExpression expression = expressionFactory.createValueExpression(elContext, expressionString, Object.class); return new BindingValueExpression(expression, getExpectedType(context), conversionService, context.isTemplate()); }
private Object convertValueIfNecessary(Object value, Class<?> expectedType, Object context) throws ValueCoercionException { if (expectedType == null) { return value; } else { try { return conversionService.executeConversion(value, expectedType); } catch (ConversionException e) { throw new ValueCoercionException(context.getClass(), getExpressionString(), value, expectedType, e); } } }
private ValueExpression parseValueExpression(String expressionString, ParserContext context) throws ELException { ParserELContext elContext = new ParserELContext(); elContext.mapVariables(context.getExpressionVariables(), expressionFactory); ValueExpression expression = expressionFactory.createValueExpression(elContext, expressionString, Object.class); return new BindingValueExpression(expression, getExpectedType(context), conversionService, context.isTemplate()); }
public Object getValue(ELContext context) throws NullPointerException, PropertyNotFoundException, ELException, ValueCoercionException { Object value = targetExpression.getValue(context); return convertValueIfNecessary(value, expectedType, context); }
private Object convertValueIfNecessary(Object value, Class expectedType, Object context) throws ValueCoercionException { if (expectedType == null) { return value; } else { try { return conversionService.executeConversion(value, expectedType); } catch (ConversionException e) { throw new ValueCoercionException(context.getClass(), getExpressionString(), value, expectedType, e); } } }
private ValueExpression parseValueExpression(String expressionString, ParserContext context) throws ELException { ParserELContext elContext = new ParserELContext(); elContext.mapVariables(context.getExpressionVariables(), expressionFactory); ValueExpression expression = expressionFactory.createValueExpression(elContext, expressionString, Object.class); return new BindingValueExpression(expression, getExpectedType(context), conversionService, context.isTemplate()); }
public Object getValue(ELContext context) throws NullPointerException, ELException, ValueCoercionException { Object value = targetExpression.getValue(context); return convertValueIfNecessary(value, expectedType, context); }
public void setValue(ELContext context, Object value) throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException, ValueCoercionException { value = convertValueIfNecessary(value, targetExpression.getType(context), context); targetExpression.setValue(context, value); }
public void setValue(ELContext context, Object value) throws NullPointerException, ELException, ValueCoercionException { value = convertValueIfNecessary(value, targetExpression.getType(context), context); targetExpression.setValue(context, value); }
public void setValue(ELContext context, Object value) throws NullPointerException, ELException, ValueCoercionException { value = convertValueIfNecessary(value, targetExpression.getType(context), context); targetExpression.setValue(context, value); }