Class AntFileSetSourceAnalyzer

  • All Implemented Interfaces:
    groovy.lang.GroovyObject, SourceAnalyzer

    public class AntFileSetSourceAnalyzer
    extends AbstractSourceAnalyzer
    SourceAnalyzer implementation that gets source files from one or more Ant FileSets.
    • Field Detail

      • LOG

        private static final org.slf4j.Logger LOG
      • project

        private final org.apache.tools.ant.Project project
      • fileSets

        protected final java.util.List<org.apache.tools.ant.types.FileSet> fileSets
      • resultsMap

        private final java.util.concurrent.ConcurrentMap<java.lang.String,​java.util.List<FileResults>> resultsMap
      • fileCountMap

        private final java.util.concurrent.ConcurrentMap<java.lang.String,​java.util.concurrent.atomic.AtomicInteger> fileCountMap
    • Constructor Detail

      • AntFileSetSourceAnalyzer

        public AntFileSetSourceAnalyzer​(org.apache.tools.ant.Project project,
                                        org.apache.tools.ant.types.FileSet fileSet)
        Construct a new instance on the specified Ant FileSet.
        Parameters:
        project - - the Ant Project; must not be null
        fileSet - - the Ant FileSet; must not be null
      • AntFileSetSourceAnalyzer

        AntFileSetSourceAnalyzer​(org.apache.tools.ant.Project project,
                                 java.util.List<org.apache.tools.ant.types.FileSet> fileSets)
        Construct a new instance on the specified List of Ant FileSets.
        Parameters:
        project - - the Ant Project
        fileSets - - the List of Ant FileSet; my be empty; must not be null
    • Method Detail

      • analyze

        public Results analyze​(RuleSet ruleSet)
        Analyze all source code using the specified RuleSet and return the report results.
        Parameters:
        ruleSet - - the RuleSet to apply to each source component; must not be null.
        Returns:
        the results from applying the RuleSet to all of the source
      • getSourceDirectories

        public java.util.List getSourceDirectories()
      • processFileSet

        private void processFileSet​(org.apache.tools.ant.types.FileSet fileSet,
                                    RuleSet ruleSet,
                                    java.util.concurrent.ExecutorService pool)
      • buildTask

        private java.lang.Runnable buildTask​(java.io.File baseDir,
                                             java.lang.String filePath,
                                             RuleSet ruleSet)
      • processFile

        private void processFile​(java.io.File baseDir,
                                 java.lang.String filePath,
                                 RuleSet ruleSet)
      • incrementFileCount

        private void incrementFileCount​(java.lang.String parentPath)
      • addToResultsMap

        private void addToResultsMap​(java.lang.String parentPath,
                                     FileResults results)
      • addDirectoryResults

        private void addDirectoryResults​(DirectoryResults reportResults)