public class PMD extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
PMD.ProgressMonitor
A callback that would be implemented by IDEs keeping track of PMD's progress
as it evaluates a set of files.
|
Modifier and Type | Field and Description |
---|---|
protected PMDConfiguration |
configuration |
static String |
EOL |
static String |
SUPPRESS_MARKER |
static String |
VERSION |
Constructor and Description |
---|
PMD()
Create a PMD instance using a default Configuration.
|
PMD(PMDConfiguration configuration)
Create a PMD instance using the specified Configuration.
|
Modifier and Type | Method and Description |
---|---|
static void |
doPMD(PMDConfiguration configuration)
This method is the main entry point for command line usage.
|
static List<DataSource> |
getApplicableFiles(PMDConfiguration configuration,
Set<Language> languages) |
PMDConfiguration |
getConfiguration()
Get the runtime configuration.
|
SourceCodeProcessor |
getSourceCodeProcessor() |
static void |
main(String[] args)
Entry to invoke PMD as command line tool
|
static RuleContext |
newRuleContext(String sourceCodeFilename,
File sourceCodeFile) |
static Parser |
parserFor(LanguageVersion languageVersion,
PMDConfiguration configuration) |
static void |
processFiles(PMDConfiguration configuration,
RuleSetFactory ruleSetFactory,
Collection<File> files,
RuleContext ctx,
PMD.ProgressMonitor monitor)
An entry point that would typically be used by IDEs intent on providing
ongoing feedback and the ability to terminate it at will.
|
static void |
processFiles(PMDConfiguration configuration,
RuleSetFactory ruleSetFactory,
List<DataSource> files,
RuleContext ctx,
List<Renderer> renderers)
Run PMD on a list of files using multiple threads - if more than one is available
|
static int |
run(String[] args) |
static Report |
setupReport(RuleSets rs,
RuleContext ctx,
String fileName)
Create a report, filter out any defective rules, and keep a record of them.
|
public static final String EOL
public static final String SUPPRESS_MARKER
protected final PMDConfiguration configuration
public static final String VERSION
public PMD()
public PMD(PMDConfiguration configuration)
configuration
- The runtime Configuration of PMD to use.public static Parser parserFor(LanguageVersion languageVersion, PMDConfiguration configuration)
public static Report setupReport(RuleSets rs, RuleContext ctx, String fileName)
rs
- ctx
- fileName
- public PMDConfiguration getConfiguration()
PMDConfiguration
public SourceCodeProcessor getSourceCodeProcessor()
public static void doPMD(PMDConfiguration configuration)
configuration
- public static RuleContext newRuleContext(String sourceCodeFilename, File sourceCodeFile)
public static void processFiles(PMDConfiguration configuration, RuleSetFactory ruleSetFactory, Collection<File> files, RuleContext ctx, PMD.ProgressMonitor monitor)
configuration
- ruleSetFactory
- files
- ctx
- monitor
- public static void processFiles(PMDConfiguration configuration, RuleSetFactory ruleSetFactory, List<DataSource> files, RuleContext ctx, List<Renderer> renderers)
configuration
- ConfigurationruleSetFactory
- RuleSetFactoryfiles
- Listctx
- RuleContextrenderers
- Listpublic static List<DataSource> getApplicableFiles(PMDConfiguration configuration, Set<Language> languages)
configuration
- Configurationlanguages
- Setpublic static void main(String[] args)
args
- public static int run(String[] args)
args
- String[]Copyright © 2002-2013 InfoEther. All Rights Reserved.