Klasse ExcludeViolationsFromFile

java.lang.Object
org.apache.maven.plugins.pmd.ExcludeViolationsFromFile
Alle implementierten Schnittstellen:
ExcludeFromFile<Violation>

public class ExcludeViolationsFromFile extends Object implements ExcludeFromFile<Violation>
This class contains utility for loading property files, which define which PMD violations from which classes should be ignored and not cause a failure. See property pmd.excludeFromFailureFile.
Autor:
Andreas Dangel
  • Konstruktordetails

    • ExcludeViolationsFromFile

      public ExcludeViolationsFromFile()
  • Methodendetails

    • loadExcludeFromFailuresData

      public void loadExcludeFromFailuresData(String excludeFromFailureFile) throws org.apache.maven.plugin.MojoExecutionException
      Beschreibung aus Schnittstelle kopiert: ExcludeFromFile
      Loads the exclude definitions from the given file.
      Angegeben von:
      loadExcludeFromFailuresData in Schnittstelle ExcludeFromFile<Violation>
      Parameter:
      excludeFromFailureFile - the path to the properties file
      Löst aus:
      org.apache.maven.plugin.MojoExecutionException - if the properties file couldn't be loaded
    • isExcludedFromFailure

      public boolean isExcludedFromFailure(Violation errorDetail)
      Beschreibung aus Schnittstelle kopiert: ExcludeFromFile
      Checks whether the given violation is excluded. Note: the exclusions must have been loaded before via ExcludeFromFile.loadExcludeFromFailuresData(String).
      Angegeben von:
      isExcludedFromFailure in Schnittstelle ExcludeFromFile<Violation>
      Parameter:
      errorDetail - the violation to check
      Gibt zurück:
      true if the violation should be excluded, false otherwise.
    • isExcludedFromFailure

      public boolean isExcludedFromFailure(net.sourceforge.pmd.reporting.RuleViolation errorDetail)
      Checks whether the given RuleViolation is excluded. Note: the exclusions must have been loaded before via loadExcludeFromFailuresData(String).
      Parameter:
      errorDetail - the violation to check
      Gibt zurück:
      true if the violation should be excluded, false otherwise.
    • countExclusions

      public int countExclusions()
      Beschreibung aus Schnittstelle kopiert: ExcludeFromFile
      Determines how many exclusions are considered.
      Angegeben von:
      countExclusions in Schnittstelle ExcludeFromFile<Violation>
      Gibt zurück:
      the number of active exclusions