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

Examples of com.buschmais.jqassistant.core.analysis.api.rule.RuleSet


        RuleSelector ruleSelector = new RuleSelectorImpl();
        return ruleSelector.getEffectiveRuleSet(availableRules, conceptNames, constraintNames, groupNames);
    }

    public InMemoryReportWriter analyze(Store store, List<String> conceptNames, List<String> constraintNames, List<String> groupNames) throws Exception {
        RuleSet effectiveRuleSet = getEffectiveRuleSet(conceptNames, constraintNames, groupNames);
        InMemoryReportWriter reportWriter = new InMemoryReportWriter();
        Slf4jConsole console = new Slf4jConsole();
        Analyzer analyzer = new AnalyzerImpl(store, reportWriter, console);
        analyzer.execute(effectiveRuleSet);
        ReportHelper reportHelper = new ReportHelper(console);
View Full Code Here


  private static final Logger LOGGER = LoggerFactory.getLogger(RuleSelectorImpl.class);

  @Override
  public RuleSet getEffectiveRuleSet(RuleSet ruleSet, List<String> conceptNames, List<String> constraintNames, List<String> groupNames)
      throws RuleSetResolverException {
    RuleSet effectiveRuleSet = new RuleSet();
    // Use the default group if no group, constraint or concept is
    // specified.
    List<String> selectedGroupNames;
    if (CollectionUtils.isEmpty(groupNames) && CollectionUtils.isEmpty(constraintNames) && CollectionUtils.isEmpty(conceptNames)) {
      selectedGroupNames = Arrays.asList(new String[] { DEFAULT_GROUP });
View Full Code Here

     * @return The resolved rules set.
     * @throws MojoExecutionException
     *             If resolving fails.
     */
    protected RuleSet resolveEffectiveRules(MavenProject baseProject) throws MojoExecutionException {
        RuleSet ruleSet = readRules(baseProject);
        validateRuleSet(ruleSet);
        try {
            return ruleSelector.getEffectiveRuleSet(ruleSet, concepts, constraints, groups);
        } catch (RuleSetResolverException e) {
            throw new MojoExecutionException("Cannot resolve rules.", e);
View Full Code Here

public class AvailableRulesMojo extends AbstractAnalysisMojo {

    @Override
    public void aggregate(MavenProject baseProject, Set<MavenProject> projects, Store store) throws MojoExecutionException, MojoFailureException {
        getLog().info("Available rules for '" + baseProject.getName() + "'.");
        RuleSet ruleSet = readRules(baseProject);
        ReportHelper reportHelper = new ReportHelper(new MavenConsole(getLog()));
        reportHelper.printRuleSet(ruleSet);
    }
View Full Code Here

public class ExportRulesMojo extends AbstractAnalysisMojo {

    @Override
    protected void aggregate(MavenProject baseProject, Set<MavenProject> projects, Store store) throws MojoExecutionException, MojoFailureException {
        getLog().info("Exporting rules for '" + baseProject.getName() + "'.");
        final RuleSet ruleSet = resolveEffectiveRules(baseProject);
        RuleSetWriter ruleSetWriter = new RuleSetWriterImpl();
        String exportedRules = baseProject.getBuild().getDirectory() + "/jqassistant/jqassistant-rules.xml";
        Writer writer;
        try {
            writer = new FileWriter(exportedRules);
View Full Code Here

public class EffectiveRulesMojo extends AbstractAnalysisMojo {

    @Override
    public void aggregate(MavenProject baseProject, Set<MavenProject> projects, Store store) throws MojoExecutionException, MojoFailureException {
        getLog().info("Effective rules for '" + baseProject.getName() + "'.");
        RuleSet targetRuleSet = resolveEffectiveRules(baseProject);
        ReportHelper reportHelper = new ReportHelper(new MavenConsole(getLog()));
        reportHelper.printRuleSet(targetRuleSet);
    }
View Full Code Here

    private Map<String, Object> reportProperties;

    @Override
    public void aggregate(MavenProject baseProject, Set<MavenProject> projects, Store store) throws MojoExecutionException, MojoFailureException {
        getLog().info("Executing analysis for '" + baseProject.getName() + "'.");
        final RuleSet ruleSet = resolveEffectiveRules(baseProject);
        List<AnalysisListener> reportWriters = new LinkedList<>();
        InMemoryReportWriter inMemoryReportWriter = new InMemoryReportWriter();
        reportWriters.add(inMemoryReportWriter);
        if (reportTypes == null || reportTypes.isEmpty()) {
            reportTypes = Arrays.asList(ReportType.JQA);
View Full Code Here

    private static final Logger LOGGER = LoggerFactory.getLogger(RuleSelectorImpl.class);

    @Override
    public RuleSet getEffectiveRuleSet(RuleSet ruleSet, List<String> conceptNames, List<String> constraintNames, List<String> groupNames)
            throws RuleSetResolverException {
        RuleSet effectiveRuleSet = new RuleSet();
        // Use the default group if no group, constraint or concept is
        // specified.
        List<String> selectedGroupNames;
        if (CollectionUtils.isEmpty(groupNames) && CollectionUtils.isEmpty(constraintNames) && CollectionUtils.isEmpty(conceptNames)) {
            selectedGroupNames = Arrays.asList(new String[] { DEFAULT_GROUP });
View Full Code Here

TOP

Related Classes of com.buschmais.jqassistant.core.analysis.api.rule.RuleSet

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.