code: private Severity getSeverity(Attributes attributes, Severity defaultSeverity) throws RuleException {
          String severity = attributes.getString(SEVERITY);
          if (severity == null) {
              return defaultSeverity;
          }
          Severity value = Severity.fromValue(severity.toLowerCase());
          return value != null ? value : defaultSeverity;
      }
docs: Extract the optional severity of a rule.
  
  @param attributes
  The attributes of the rule.
  @param defaultSeverity
  The default severity to use if no severity is specified.
  @return The severity.