コード例 #1
0
 @Override
 public Object getValue(ELContext context) {
   if (this.expectedType != null) {
     return ELSupport.coerceToType(this.value, this.expectedType);
   }
   return this.value;
 }
コード例 #2
0
 /*
  * This class duplicates code in javax.el.Util. When making changes keep
  * the code in sync.
  */
 private static boolean isCoercibleFrom(Object src, Class<?> target) {
   // TODO: This isn't pretty but it works. Significant refactoring would
   //       be required to avoid the exception.
   try {
     ELSupport.coerceToType(src, target);
   } catch (ELException e) {
     return false;
   }
   return true;
 }