org.apache.maven.plugin.pmd
Class AbstractPmdViolationCheckMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugin.pmd.AbstractPmdViolationCheckMojo
- All Implemented Interfaces:
- org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
- CpdViolationCheckMojo, PmdViolationCheckMojo
public abstract class AbstractPmdViolationCheckMojo
- extends org.apache.maven.plugin.AbstractMojo
Base class for mojos that check if there were any PMD violations.
- Version:
- $Id: AbstractPmdViolationCheckMojo.java 939759 2010-04-30 17:49:46Z hboutemy $
- Author:
- Brett Porter
Field Summary |
protected boolean |
aggregate
Whether to build an aggregated report at the root, or build individual reports. |
protected org.apache.maven.project.MavenProject |
project
The project to analyze. |
Fields inherited from interface org.apache.maven.plugin.Mojo |
ROLE |
Method Summary |
protected void |
executeCheck(String filename,
String tagName,
String key,
int failurePriority)
|
protected abstract Map |
getErrorDetails(org.codehaus.plexus.util.xml.pull.XmlPullParser xpp)
Gets the attributes and text for the violation tag and puts them in a
HashMap |
protected abstract void |
printError(Map item,
String severity)
Formats the failure details and prints them as an INFO message |
protected void |
printErrors(List failures,
List warnings)
Prints the warnings and failures |
Methods inherited from class org.apache.maven.plugin.AbstractMojo |
getLog, getPluginContext, setLog, setPluginContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.maven.plugin.Mojo |
execute |
aggregate
protected boolean aggregate
- Whether to build an aggregated report at the root, or build individual reports.
- Since:
- 2.2
project
protected org.apache.maven.project.MavenProject project
- The project to analyze.
AbstractPmdViolationCheckMojo
public AbstractPmdViolationCheckMojo()
executeCheck
protected void executeCheck(String filename,
String tagName,
String key,
int failurePriority)
throws org.apache.maven.plugin.MojoFailureException,
org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
printErrors
protected void printErrors(List failures,
List warnings)
- Prints the warnings and failures
- Parameters:
failures
- list of failureswarnings
- list of warnings
printError
protected abstract void printError(Map item,
String severity)
- Formats the failure details and prints them as an INFO message
- Parameters:
item
-
getErrorDetails
protected abstract Map getErrorDetails(org.codehaus.plexus.util.xml.pull.XmlPullParser xpp)
throws org.codehaus.plexus.util.xml.pull.XmlPullParserException,
IOException
- Gets the attributes and text for the violation tag and puts them in a
HashMap
- Parameters:
xpp
-
- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException
IOException
Copyright © 2005-2011 Apache Software Foundation. All Rights Reserved.