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

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


     */
    private List<Constraint> getSelectedConstraints(List<String> constraintNames, RuleSet ruleSet) throws RuleSetResolverException {
        final List<Constraint> selectedConstraints = new ArrayList<>();
        if (constraintNames != null) {
            for (String constraintName : constraintNames) {
                Constraint concept = ruleSet.getConstraints().get(constraintName);
                if (concept == null) {
                    throw new RuleSetResolverException("The constraint '" + constraintName + "' is not defined.");
                }
                selectedConstraints.add(concept);
            }
View Full Code Here


     * @param constraintTypes      The {@link ConstraintType}s.
     * @param ruleSet              The {@link RuleSet}.
     */
    private void readConstraints(Map<String, QueryDefinitionType> queryDefinitionTypes, Map<String, ConceptType> conceptTypes, Map<String, ConstraintType> constraintTypes, RuleSet ruleSet) {
        for (ConstraintType constraintType : constraintTypes.values()) {
            Constraint constraint = getOrCreateConstraint(constraintType.getId(), ruleSet.getConstraints());
            constraint.setDescription(constraintType.getDescription());
            if (constraintType.getUseQueryDefinition() != null) {
                constraint.setQuery(createQueryFromDefinition(constraintType.getUseQueryDefinition().getRefId(), constraintType.getParameter(), queryDefinitionTypes));
            } else {
                constraint.setQuery(createQuery(constraintType.getCypher(), constraintType.getParameter()));
            }
            constraint.setRequiredConcepts(getRequiredConcepts(constraintType.getRequiresConcept(), conceptTypes, ruleSet));
        }
    }
View Full Code Here

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

TOP

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

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.