code: public static Object coerceToObject(Object pValue,
                                          Class pClass,
                                          Logger pLogger)
              throws ELException {
          if (pValue == null) {
              return null;
          } else if (pClass.isAssignableFrom(pValue.getClass())) {
              return pValue;
          } else if (pValue instanceof String) {
              String str = (String) pValue;
              PropertyEditor pe = PropertyEditorManager.findEditor(pClass);
              if (pe == null) {
                  if ("".equals(str)) {
                      return null;
                  } else {
                      if (pLogger.isLoggingError()) {
                          pLogger.logError
                                  (Constants.NO_PROPERTY_EDITOR,
                                          str,
                                          pClass.getName());
                      }
                      return null;
                  }
              }
              try {
                  pe.setAsText(str);
                  return pe.getValue();
              }
              catch (IllegalArgumentException exc) {
                  if ("".equals(str)) {
                      return null;
                  } else {
                      if (pLogger.isLoggingError()) {
                          pLogger.logError
                                  (Constants.PROPERTY_EDITOR_ERROR,
                                          exc,
                                          pValue,
                                          pClass.getName());
                      }
                      return null;
                  }
              }
          } else {
              if (pLogger.isLoggingError()) {
                  pLogger.logError
                          (Constants.COERCE_TO_OBJECT,
                                  pValue.getClass().getName(),
                                  pClass.getName());
              }
              return null;
          }
      }
docs: Coerces a value to the specified Class that is not covered by any
  of the above cases