code: public static Integer coerceToInteger(Object pValue,
                                            Logger pLogger)
              throws ELException {
          if (pValue == null) {
              return null;
          } else if (pValue instanceof Character) {
              return PrimitiveObjects.getInteger
                      ((int) (((Character) pValue).charValue()));
          } else if (pValue instanceof Boolean) {
              if (pLogger.isLoggingWarning()) {
                  pLogger.logWarning(Constants.BOOLEAN_TO_NUMBER,
                          pValue,
                          Integer.class.getName());
              }
              return PrimitiveObjects.getInteger
                      (((Boolean) pValue).booleanValue() ? 1 : 0);
          } else if (pValue instanceof Integer) {
              return (Integer) pValue;
          } else if (pValue instanceof Number) {
              return PrimitiveObjects.getInteger(((Number) pValue).intValue());
          } else if (pValue instanceof String) {
              try {
                  return Integer.valueOf((String) pValue);
              }
              catch (Exception exc) {
                  if (pLogger.isLoggingWarning()) {
                      pLogger.logWarning
                              (Constants.STRING_TO_NUMBER_EXCEPTION,
                                      (String) pValue,
                                      Integer.class.getName());
                  }
                  return null;
              }
          } else {
              if (pLogger.isLoggingWarning()) {
                  pLogger.logWarning
                          (Constants.COERCE_TO_NUMBER,
                                  pValue.getClass().getName(),
                                  Integer.class.getName());
              }
              return null;
          }
      }
docs: Coerces a value to an Integer, returning null if the coercion
  isn't possible.