Package net.sourceforge.pmd

Examples of net.sourceforge.pmd.RuleSetFactory


        reportListener = new PmdReportListener();
        PMDConfiguration pmdConfiguration = getPMDConfiguration();
        RuleContext ruleContext = new RuleContext();
        ruleContext.getReport().addListener( reportListener );

        RuleSetFactory ruleSetFactory = new RuleSetFactory();
        ruleSetFactory.setMinimumPriority( RulePriority.valueOf( this.minimumPriority ) );

        // Workaround for https://sourceforge.net/p/pmd/bugs/1155/: add a dummy ruleset.
        String[] presentRulesets = rulesets.length > 0 ? rulesets : new String [] { "/rulesets/dummy.xml" };

        String[] sets = new String[presentRulesets.length];
View Full Code Here


        report.addListener( reportSink );
        ruleContext.setReport( report );
        reportSink.beginDocument();

        RuleSetFactory ruleSetFactory = new RuleSetFactory();
        ruleSetFactory.setMinimumPriority( this.minimumPriority );
        RuleSet[] sets = new RuleSet[rulesets.length];
        try
        {
            for ( int idx = 0; idx < rulesets.length; idx++ )
            {
                String set = rulesets[idx];
                getLog().debug( "Preparing ruleset: " + set );
                File ruleset = locator.getResourceAsFile( set, getLocationTemp( set ) );

                if ( null == ruleset )
                {
                    throw new MavenReportException( "Could not resolve " + set );
                }

                InputStream rulesInput = new FileInputStream( ruleset );
                try
                {
                    RuleSet ruleSet = ruleSetFactory.createRuleSet( rulesInput );
                    sets[idx] = ruleSet;

                    ruleSet.start( ruleContext );
                }
                finally
View Full Code Here

                report.addListener( reportSink );
            }
        };
        reportSink.beginDocument();

        RuleSetFactory ruleSetFactory = new RuleSetFactory();
        ruleSetFactory.setMinimumPriority( RulePriority.valueOf( this.minimumPriority ) );
        String[] sets = new String[rulesets.length];
        try
        {
            for ( int idx = 0; idx < rulesets.length; idx++ )
            {
View Full Code Here

   private RuleSet loadRuleset( final File ruleSetFile ) throws URISyntaxException,
                                                        IOException
   {
      final File realRuleSet = extractRuleset( ruleSetFile );
      final FileInputStream inputStream = new FileInputStream( realRuleSet );
      final RuleSet loadedRuleSet = new RuleSetFactory().createRuleSet( inputStream );

      LOGGER.info( "Ruleset: "
            + realRuleSet.getAbsolutePath() );
      LOGGER.info( "Rules number in the ruleSet: "
            + loadedRuleSet.getRules().size() );
View Full Code Here

        reportListener = new PmdReportListener();
        PMDConfiguration pmdConfiguration = getPMDConfiguration();
        RuleContext ruleContext = new RuleContext();
        ruleContext.getReport().addListener( reportListener );

        RuleSetFactory ruleSetFactory = new RuleSetFactory();
        ruleSetFactory.setMinimumPriority( RulePriority.valueOf( this.minimumPriority ) );

        // Workaround for https://sourceforge.net/p/pmd/bugs/1155/: add a dummy ruleset.
        String[] presentRulesets = rulesets.length > 0 ? rulesets : new String [] { "/rulesets/dummy.xml" };

        String[] sets = new String[presentRulesets.length];
View Full Code Here

TOP

Related Classes of net.sourceforge.pmd.RuleSetFactory

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.