Class Plugin


  • public class Plugin
    extends java.lang.Object
    A FindBugs plugin. A plugin contains executable Detector classes, as well as meta information decribing those detectors (such as human-readable detector and bug descriptions).
    Author:
    David Hovemeyer
    See Also:
    PluginLoader
    • Constructor Detail

      • Plugin

        public Plugin​(java.lang.String pluginId,
                      PluginLoader pluginLoader)
        Constructor. Creates an empty plugin object.
        Parameters:
        pluginId - the plugin's unique identifier
    • Method Detail

      • setEnabled

        public void setEnabled​(boolean enabled)
        Set whether or not this Plugin is enabled.
        Parameters:
        enabled - true if the Plugin is enabled, false if not
      • isEnabled

        public boolean isEnabled()
        Return whether or not the Plugin is enabled.
        Returns:
        true if the Plugin is enabled, false if not
      • setProvider

        public void setProvider​(java.lang.String provider)
        Set plugin provider.
        Parameters:
        provider - the plugin provider
      • getProvider

        public java.lang.String getProvider()
        Get the plugin provider.
        Returns:
        the provider, or null if the provider was not specified
      • setWebsite

        public void setWebsite​(java.lang.String website)
        Set plugin website.
        Parameters:
        website - the plugin website
      • getWebsite

        public java.lang.String getWebsite()
        Get the plugin website.
        Returns:
        the website, or null if the was not specified
      • setShortDescription

        public void setShortDescription​(java.lang.String shortDescription)
        Set plugin short (one-line) text description.
        Parameters:
        shortDescription - the plugin short text description
      • getShortDescription

        public java.lang.String getShortDescription()
        Get the plugin short (one-line) description.
        Returns:
        the short description, or null if the short description was not specified
      • addDetectorFactory

        public void addDetectorFactory​(DetectorFactory factory)
        Add a DetectorFactory for a Detector implemented by the Plugin.
        Parameters:
        factory - the DetectorFactory
      • addBugPattern

        public void addBugPattern​(BugPattern bugPattern)
        Add a BugPattern reported by the Plugin.
        Parameters:
        bugPattern -
      • addBugCode

        public void addBugCode​(BugCode bugCode)
        Add a BugCode reported by the Plugin.
        Parameters:
        bugCode -
      • addInterPassOrderingConstraint

        public void addInterPassOrderingConstraint​(DetectorOrderingConstraint constraint)
        Add an inter-pass Detector ordering constraint.
        Parameters:
        constraint - the inter-pass Detector ordering constraint
      • addIntraPassOrderingConstraint

        public void addIntraPassOrderingConstraint​(DetectorOrderingConstraint constraint)
        Add an intra-pass Detector ordering constraint.
        Parameters:
        constraint - the intra-pass Detector ordering constraint
      • getFactoryByShortName

        public DetectorFactory getFactoryByShortName​(java.lang.String shortName)
        Look up a DetectorFactory by short name.
        Parameters:
        shortName - the short name
        Returns:
        the DetectorFactory
      • getFactoryByFullName

        public DetectorFactory getFactoryByFullName​(java.lang.String fullName)
        Look up a DetectorFactory by full name.
        Parameters:
        fullName - the full name
        Returns:
        the DetectorFactory
      • detectorFactoryIterator

        public java.util.Iterator<DetectorFactory> detectorFactoryIterator()
        Get Iterator over DetectorFactory objects in the Plugin.
        Returns:
        Iterator over DetectorFactory objects
      • bugPatternIterator

        public java.util.Iterator<BugPattern> bugPatternIterator()
        Get Iterator over BugPattern objects in the Plugin.
        Returns:
        Iterator over BugPattern objects
      • bugCodeIterator

        public java.util.Iterator<BugCode> bugCodeIterator()
        Get Iterator over BugCode objects in the Plugin.
        Returns:
        Iterator over BugCode objects
      • interPassConstraintIterator

        public java.util.Iterator<DetectorOrderingConstraint> interPassConstraintIterator()
        Return an Iterator over the inter-pass Detector ordering constraints.
      • intraPassConstraintIterator

        public java.util.Iterator<DetectorOrderingConstraint> intraPassConstraintIterator()
        Return an Iterator over the intra-pass Detector ordering constraints.
      • getPluginId

        public java.lang.String getPluginId()
        Returns:
        Returns the pluginId.
      • setEngineRegistrarClass

        public void setEngineRegistrarClass​(java.lang.Class<? extends IAnalysisEngineRegistrar> engineRegistrarClass)
        Set the analysis engine registrar class that, when instantiated, can be used to register the plugin's analysis engines with the analysis cache.
        Parameters:
        engineRegistrarClass - The engine registrar class to set.
      • getEngineRegistrarClass

        public java.lang.Class<? extends IAnalysisEngineRegistrar> getEngineRegistrarClass()
        Get the analysis engine registrar class that, when instantiated, can be used to register the plugin's analysis engines with the analysis cache.
        Returns:
        Returns the engine registrar class.
      • getPluginLoader

        public PluginLoader getPluginLoader()
        Returns:
        Returns the pluginLoader.
      • setBugRanker

        public void setBugRanker​(BugRanker ranker)
        Parameters:
        ranker -
      • getBugRanker

        public BugRanker getBugRanker()