private Map<String, List<ActiveRuleType>> initializeAllActiveViolationTypes() {
    Map<String, List<ActiveRuleType>> activeViolationTypes =
        new HashMap<String, List<ActiveRuleType>>();

    for (String programmingLanguage : analsyseService.getAvailableLanguages()) {
      List<ActiveRuleType> activeRuleTypes = new ArrayList<ActiveRuleType>();
      activeViolationTypes.put(programmingLanguage, activeRuleTypes);

      for (List<RuleType> ruleTypes : ruletypesfactory.getRuleTypes(programmingLanguage).values()) {

        for (RuleType ruleType : ruleTypes) {
          ActiveRuleType activeRuleType = initializeActiveViolationTypes(ruleType);
          activeRuleTypes.add(activeRuleType);

          for (RuleType exceptionRuleType : ruleType.getExceptionrules()) {
            try {
              containsRuleType(activeRuleTypes, exceptionRuleType.getKey());
              activeRuleTypes.add(initializeActiveViolationTypes(exceptionRuleType));
            } catch (RuntimeException e) {

            }
          }
        }
      }
    }
    return activeViolationTypes;
  }
 private void loadViolationType(String ruletypeKey) {
   for (RuleType ruletype : ruletypes) {
     if (ruletype.getKey().equals(ruletypeKey)) {
       clearModel(violationtypeModel);
       for (ViolationType violationtype : ruletype.getViolationTypes()) {
         violationtypeModel.addRow(
             new Object[] {violationtype.getViolationtypeKey(), 1, violationtype.isActive()});
       }
     }
   }
 }
  private ActiveRuleType initializeActiveViolationTypes(RuleType ruleType) {
    final String ruleTypeKey = ruleType.getKey();
    List<ActiveViolationType> initialActiveViolationTypes = new ArrayList<ActiveViolationType>();

    for (ViolationType violationType : ruleType.getViolationTypes()) {
      final String violationTypeKey = violationType.getViolationtypeKey();
      boolean enabled = violationType.isActive();
      ActiveViolationType activeViolationType = new ActiveViolationType(violationTypeKey, enabled);
      initialActiveViolationTypes.add(activeViolationType);
    }
    ActiveRuleType activeRuleType = new ActiveRuleType(ruleTypeKey);
    activeRuleType.setViolationTypes(initialActiveViolationTypes);
    return activeRuleType;
  }
  private HashMap<String, HashMap<String, Severity>> initializeDefaultSeverityForLanguage(
      String programmingLanguage) {
    HashMap<String, HashMap<String, Severity>> severitiesPerTypePerProgrammingLanguage =
        new HashMap<String, HashMap<String, Severity>>();
    severitiesPerTypePerProgrammingLanguage.put(
        programmingLanguage, new HashMap<String, Severity>());
    for (Entry<String, List<RuleType>> entry :
        ruletypefactory.getRuleTypes(programmingLanguage).entrySet()) {
      HashMap<String, Severity> severityPerType =
          severitiesPerTypePerProgrammingLanguage.get(programmingLanguage);

      for (RuleType ruleType : entry.getValue()) {
        severityPerType.put(ruleType.getKey(), ruleType.getSeverity());

        for (ViolationType violationType : ruleType.getViolationTypes()) {
          severityPerType.put(violationType.getViolationtypeKey(), violationType.getSeverity());
        }
      }
    }

    return severitiesPerTypePerProgrammingLanguage;
  }
 private void LoadRuleTypes() {
   for (RuleType ruletype : ruletypes) {
     ruletypeModel.addRow(new Object[] {ruletype.getKey(), ts.getAllSeverities().get(0)});
   }
 }