Package com.buschmais.jqassistant.core.model.api.rule

Examples of com.buschmais.jqassistant.core.model.api.rule.Group


     * @throws RuleSetResolverException If an undefined group is referenced.
     */
    private List<Group> getSelectedGroups(List<String> groupNames, RuleSet ruleSet) throws RuleSetResolverException {
        final List<Group> selectedGroups = new ArrayList<>();
        for (String groupName : groupNames) {
            Group group = ruleSet.getGroups().get(groupName);
            if (group == null) {
                throw new RuleSetResolverException("The group '" + groupName + "' is not defined.");
            }
            selectedGroups.add(group);
        }
View Full Code Here


     * @param groupTypes      The {@link GroupType}s.
     * @param ruleSet         The {@link RuleSet}.
     */
    private void readGroups(Map<String, ConceptType> conceptTypes, Map<String, ConstraintType> constraintTypes, Map<String, GroupType> groupTypes, RuleSet ruleSet) {
        for (GroupType groupType : groupTypes.values()) {
            Group group = getOrCreateGroup(groupType.getId(), ruleSet.getGroups());
            for (ReferenceType referenceType : groupType.getIncludeConcept()) {
                ConceptType includedConceptType = conceptTypes.get(referenceType.getRefId());
                if (includedConceptType == null) {
                    ruleSet.getMissingConcepts().add(referenceType.getRefId());
                } else {
                    group.getConcepts().add(getOrCreateConcept(referenceType.getRefId(), ruleSet.getConcepts()));
                }
            }
            for (ReferenceType referenceType : groupType.getIncludeConstraint()) {
                ConstraintType includedConstraintType = constraintTypes.get(referenceType.getRefId());
                if (includedConstraintType == null) {
                    ruleSet.getMissingConstraints().add(referenceType.getRefId());
                } else {
                    group.getConstraints().add(getOrCreateConstraint(referenceType.getRefId(), ruleSet.getConstraints()));
                }
            }
            for (ReferenceType referenceType : groupType.getIncludeGroup()) {
                GroupType includedConstraintType = groupTypes.get(referenceType.getRefId());
                if (includedConstraintType == null) {
                    ruleSet.getMissingGroups().add(referenceType.getRefId());
                } else {
                    group.getGroups().add(getOrCreateGroup(referenceType.getRefId(), ruleSet.getGroups()));
                }
            }
        }
    }
View Full Code Here

     * @param id     The id.
     * @param groups The {@link com.buschmais.jqassistant.core.model.api.rule.Group}s.
     * @return The {@link com.buschmais.jqassistant.core.model.api.rule.Group}.
     */
    private Group getOrCreateGroup(String id, Map<String, Group> groups) {
        Group group = groups.get(id);
        if (group == null) {
            group = new Group();
            group.setId(id);
            groups.put(id, group);
        }
        return group;
    }
View Full Code Here

TOP

Related Classes of com.buschmais.jqassistant.core.model.api.rule.Group

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.