Package org.apache.maven.plugins.pmd
Class ExcludeDuplicationsFromFile
- java.lang.Object
-
- org.apache.maven.plugins.pmd.ExcludeDuplicationsFromFile
-
- All Implemented Interfaces:
ExcludeFromFile<Duplication>
public class ExcludeDuplicationsFromFile extends java.lang.Object implements ExcludeFromFile<Duplication>
This class contains utility methods to load property files which define which files should be excluded from the CPD duplication results. See propertypmd.excludeFromFailureFile.- Author:
- Andreas Dangel
-
-
Constructor Summary
Constructors Constructor Description ExcludeDuplicationsFromFile()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountExclusions()Determines how many exclusions are considered.booleanisExcludedFromFailure(net.sourceforge.pmd.cpd.Match errorDetail)Checks whether the givenMatchis excluded.booleanisExcludedFromFailure(Duplication errorDetail)Checks whether the given violation is excluded.voidloadExcludeFromFailuresData(java.lang.String excludeFromFailureFile)Loads the exclude definitions from the given file.
-
-
-
Method Detail
-
isExcludedFromFailure
public boolean isExcludedFromFailure(Duplication errorDetail)
Description copied from interface:ExcludeFromFileChecks whether the given violation is excluded. Note: the exclusions must have been loaded before viaExcludeFromFile.loadExcludeFromFailuresData(String).- Specified by:
isExcludedFromFailurein interfaceExcludeFromFile<Duplication>- Parameters:
errorDetail- the violation to check- Returns:
trueif the violation should be excluded,falseotherwise.
-
isExcludedFromFailure
public boolean isExcludedFromFailure(net.sourceforge.pmd.cpd.Match errorDetail)
Checks whether the givenMatchis excluded. Note: The exclusion must have been loaded before vialoadExcludeFromFailuresData(String).- Parameters:
errorDetail- the duplication to check- Returns:
trueif the given duplication should be excluded,falseotherwise.
-
loadExcludeFromFailuresData
public void loadExcludeFromFailuresData(java.lang.String excludeFromFailureFile) throws MojoExecutionExceptionDescription copied from interface:ExcludeFromFileLoads the exclude definitions from the given file.- Specified by:
loadExcludeFromFailuresDatain interfaceExcludeFromFile<Duplication>- Parameters:
excludeFromFailureFile- the path to the properties file- Throws:
MojoExecutionException- if the properties file couldn't be loaded
-
countExclusions
public int countExclusions()
Description copied from interface:ExcludeFromFileDetermines how many exclusions are considered.- Specified by:
countExclusionsin interfaceExcludeFromFile<Duplication>- Returns:
- the number of active exclusions
-
-