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

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


     */
    private List<Concept> getSelectedConcepts(List<String> conceptNames, RuleSet ruleSet) throws RuleSetResolverException {
        final List<Concept> selectedConcepts = new ArrayList<>();
        if (conceptNames != null) {
            for (String conceptName : conceptNames) {
                Concept concept = ruleSet.getConcepts().get(conceptName);
                if (concept == null) {
                    throw new RuleSetResolverException("The concept '" + conceptName + "' is not defined.");
                }
                selectedConcepts.add(concept);
            }
View Full Code Here


     * @param conceptTypes         The {@link ConceptType}s.
     * @param ruleSet              The {@link RuleSet}.
     */
    private void readConcepts(Map<String, QueryDefinitionType> queryDefinitionTypes, Map<String, ConceptType> conceptTypes, RuleSet ruleSet) {
        for (ConceptType conceptType : conceptTypes.values()) {
            Concept concept = getOrCreateConcept(conceptType.getId(), ruleSet.getConcepts());
            concept.setDescription(conceptType.getDescription());
            if (conceptType.getUseQueryDefinition() != null) {
                concept.setQuery(createQueryFromDefinition(conceptType.getUseQueryDefinition().getRefId(), conceptType.getParameter(), queryDefinitionTypes));
            } else {
                concept.setQuery(createQuery(conceptType.getCypher(), conceptType.getParameter()));
            }
            concept.setRequiredConcepts(getRequiredConcepts(conceptType.getRequiresConcept(), conceptTypes, ruleSet));
        }
    }
View Full Code Here

     * @param id       The id.
     * @param concepts The {@link Concept}s.
     * @return The {@link Concept}.
     */
    private Concept getOrCreateConcept(String id, Map<String, Concept> concepts) {
        Concept concept = concepts.get(id);
        if (concept == null) {
            concept = new Concept();
            concept.setId(id);
            concepts.put(id, concept);
        }
        return concept;
    }
View Full Code Here

TOP

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

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.