static Object invokeMethod(ELContext context, Method m, Object base, Object[] params) { Class[] parameterTypes = m.getParameterTypes(); Object[] parameters = null; if (parameterTypes.length > 0) { if (m.isVarArgs()) { // TODO } else { parameters = new Object[parameterTypes.length]; for (int i = 0; i < parameterTypes.length; i++) { parameters[i] = context.convertToType(params[i], parameterTypes[i]); } } } try { return m.invoke(base, parameters); } catch (IllegalAccessException iae) { throw new ELException(iae); } catch (InvocationTargetException ite) { throw new ELException(ite.getCause()); } } }
static Object invokeConstructor(ELContext context, Constructor<?> c, Object[] params) { Class[] parameterTypes = c.getParameterTypes(); Object[] parameters = null; if (parameterTypes.length > 0) { if (c.isVarArgs()) { // TODO } else { parameters = new Object[parameterTypes.length]; for (int i = 0; i < parameterTypes.length; i++) { parameters[i] = context.convertToType(params[i], parameterTypes[i]); } } } try { return c.newInstance(parameters); } catch (IllegalAccessException iae) { throw new ELException(iae); } catch (InvocationTargetException ite) { throw new ELException(ite.getCause()); } catch (InstantiationException ie) { throw new ELException(ie.getCause()); } }
@Override public Object convertToType(Object obj, Class<?> type) { return elContext.convertToType(obj, type); } }
@Override public Object convertToType(Object obj, Class<?> type) { return elContext.convertToType(obj, type); } }
@Override public Object convertToType(Object obj, Class<?> targetType) { return this.elContext.convertToType(obj, targetType); }
@Override public Object convertToType(Object obj, Class<?> type) { return wrapped.convertToType(obj, type); }
@Override public Object convertToType(Object obj, Class<?> targetType) { return this.elContext.convertToType(obj, targetType); }
@Override public Object convertToType(Object obj, Class<?> type) { return wrapped.convertToType(obj, type); }
public Object getValue(ELContext context) { if (this.expectedType != null) { try { return context.convertToType(this.value, this.expectedType); } catch (IllegalArgumentException ex) { throw new ELException(ex); } } return this.value; }
public Object invoke(ELContext context, Object[] params) throws ELException { if (this.expectedType == null) { return this.expr; } try { return context.convertToType(this.expr, this.expectedType); } catch (Exception ex) { throw new ELException (ex); } }
public Object getValue(ELContext context) { if (this.expectedType != null) { try { return context.convertToType(this.value, this.expectedType); } catch (IllegalArgumentException ex) { throw new ELException(ex); } } return this.value; }
public Object invoke(ELContext context, Object[] params) throws ELException { if (this.expectedType == null) { return this.expr; } try { return context.convertToType(this.expr, this.expectedType); } catch (Exception ex) { throw new ELException (ex); } }
public Object getValue(ELContext context) { if (this.expectedType != null) { try { return context.convertToType(this.value, this.expectedType); } catch (IllegalArgumentException ex) { throw new ELException(ex); } } return this.value; }
public Object invoke(ELContext context, Object[] params) throws ELException { if (this.expectedType == null) { return this.expr; } try { return context.convertToType(this.expr, this.expectedType); } catch (Exception ex) { throw new ELException (ex); } }
@Override public Object getValue(ELContext context) { context.notifyBeforeEvaluation(getExpressionString()); Object result; if (this.expectedType != null) { result = context.convertToType(this.value, this.expectedType); } else { result = this.value; } context.notifyAfterEvaluation(getExpressionString()); return result; }
@Override public Object getValue(ELContext context) { context.notifyBeforeEvaluation(getExpressionString()); Object result; if (this.expectedType != null) { result = context.convertToType(this.value, this.expectedType); } else { result = this.value; } context.notifyAfterEvaluation(getExpressionString()); return result; }
@Override public Object invoke(ELContext context, Object[] params) throws ELException { context.notifyBeforeEvaluation(getExpressionString()); Object result; if (this.expectedType != null) { result = context.convertToType(this.expr, this.expectedType); } else { result = this.expr; } context.notifyAfterEvaluation(getExpressionString()); return result; }
@Override public Object invoke(ELContext context, Object[] params) throws ELException { context.notifyBeforeEvaluation(getExpressionString()); Object result; if (this.expectedType != null) { result = context.convertToType(this.expr, this.expectedType); } else { result = this.expr; } context.notifyAfterEvaluation(getExpressionString()); return result; }
@Override public Object getValue(ELContext context) throws PropertyNotFoundException, ELException { EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); context.notifyBeforeEvaluation(getExpressionString()); Object value = this.getNode().getValue(ctx); if (this.expectedType != null) { value = context.convertToType(value, this.expectedType); } context.notifyAfterEvaluation(getExpressionString()); return value; }
@Override public Object getValue(ELContext context) throws PropertyNotFoundException, ELException { EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); context.notifyBeforeEvaluation(getExpressionString()); Object value = this.getNode().getValue(ctx); if (this.expectedType != null) { value = context.convertToType(value, this.expectedType); } context.notifyAfterEvaluation(getExpressionString()); return value; }