public Object coerceToType(Object obj, Class type) {
   Object ret;
   try {
     ret = ELSupport.coerceToType(obj, type);
   } catch (IllegalArgumentException ex) {
     throw new ELException(ex);
   }
   return ret;
 }
Example #2
0
 /*
  * (non-Javadoc)
  *
  * @see javax.el.ValueExpression#getValue(javax.el.ELContext)
  */
 public Object getValue(ELContext context) throws PropertyNotFoundException, ELException {
   EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper);
   Object value = this.getNode().getValue(ctx);
   if (this.expectedType != null) {
     try {
       value = ELSupport.coerceToType(value, this.expectedType);
     } catch (IllegalArgumentException ex) {
       throw new ELException(ex);
     }
   }
   return value;
 }