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; }