private <E extends Enum<E>> E safeValueOf(Class<E> enumm, String s, StringBuilder reason) {
    if (s == null || s.length() == 0) {
      return null;
    }

    try {
      return Enum.valueOf(enumm, s);
    } catch (IllegalArgumentException iaex) {
      reason.append("Invalid value provided for ").append(enumm.getName());
      return null;
    }
  }
Manages Action definitions read from XML files
ambari-server/src/main/java/org/apache/ambari/server/customactions/ActionDefinitionManager.java