edu.umd.cs.findbugs

Class Plugin

public class Plugin extends 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 Summary
Plugin(String pluginId)
Constructor.
Method Summary
voidaddBugCode(BugCode bugCode)
Add a BugCode reported by the Plugin.
voidaddBugPattern(BugPattern bugPattern)
Add a BugPattern reported by the Plugin.
voidaddDetectorFactory(DetectorFactory factory)
Add a DetectorFactory for a Detector implemented by the Plugin.
voidaddInterPassOrderingConstraint(DetectorOrderingConstraint constraint)
Add an inter-pass Detector ordering constraint.
voidaddIntraPassOrderingConstraint(DetectorOrderingConstraint constraint)
Add an intra-pass Detector ordering constraint.
Iterator<BugCode>bugCodeIterator()
Get Iterator over BugCode objects in the Plugin.
Iterator<BugPattern>bugPatternIterator()
Get Iterator over BugPattern objects in the Plugin.
Iterator<DetectorFactory>detectorFactoryIterator()
Get Iterator over DetectorFactory objects in the Plugin.
DetectorFactorygetFactoryByFullName(String fullName)
Look up a DetectorFactory by full name.
DetectorFactorygetFactoryByShortName(String shortName)
Look up a DetectorFactory by short name.
StringgetPluginId()
StringgetProvider()
Get the plugin provider.
StringgetShortDescription()
Get the plugin short (one-line) description.
StringgetWebsite()
Get the plugin website.
Iterator<DetectorOrderingConstraint>interPassConstraintIterator()
Return an Iterator over the inter-pass Detector ordering constraints.
Iterator<DetectorOrderingConstraint>intraPassConstraintIterator()
Return an Iterator over the intra-pass Detector ordering constraints.
booleanisEnabled()
Return whether or not the Plugin is enabled.
voidsetEnabled(boolean enabled)
Set whether or not this Plugin is enabled.
voidsetProvider(String provider)
Set plugin provider.
voidsetShortDescription(String shortDescription)
Set plugin short (one-line) text description.
voidsetWebsite(String website)
Set plugin website.

Constructor Detail

Plugin

public Plugin(String pluginId)
Constructor. Creates an empty plugin object.

Parameters: pluginId the plugin's unique identifier

Method Detail

addBugCode

public void addBugCode(BugCode bugCode)
Add a BugCode reported by the Plugin.

Parameters: bugCode

addBugPattern

public void addBugPattern(BugPattern bugPattern)
Add a BugPattern reported by the Plugin.

Parameters: bugPattern

addDetectorFactory

public void addDetectorFactory(DetectorFactory factory)
Add a DetectorFactory for a Detector implemented by the Plugin.

Parameters: factory the DetectorFactory

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

bugCodeIterator

public Iterator<BugCode> bugCodeIterator()
Get Iterator over BugCode objects in the Plugin.

Returns: Iterator over BugCode objects

bugPatternIterator

public Iterator<BugPattern> bugPatternIterator()
Get Iterator over BugPattern objects in the Plugin.

Returns: Iterator over BugPattern objects

detectorFactoryIterator

public Iterator<DetectorFactory> detectorFactoryIterator()
Get Iterator over DetectorFactory objects in the Plugin.

Returns: Iterator over DetectorFactory objects

getFactoryByFullName

public DetectorFactory getFactoryByFullName(String fullName)
Look up a DetectorFactory by full name.

Parameters: fullName the full name

Returns: the DetectorFactory

getFactoryByShortName

public DetectorFactory getFactoryByShortName(String shortName)
Look up a DetectorFactory by short name.

Parameters: shortName the short name

Returns: the DetectorFactory

getPluginId

public String getPluginId()

Returns: Returns the pluginId.

getProvider

public String getProvider()
Get the plugin provider.

Returns: the provider, or null if the provider was not specified

getShortDescription

public String getShortDescription()
Get the plugin short (one-line) description.

Returns: the short description, or null if the short description was not specified

getWebsite

public String getWebsite()
Get the plugin website.

Returns: the website, or null if the was not specified

interPassConstraintIterator

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

intraPassConstraintIterator

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

isEnabled

public boolean isEnabled()
Return whether or not the Plugin is enabled.

Returns: true if the Plugin is enabled, false if not

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

setProvider

public void setProvider(String provider)
Set plugin provider.

Parameters: provider the plugin provider

setShortDescription

public void setShortDescription(String shortDescription)
Set plugin short (one-line) text description.

Parameters: shortDescription the plugin short text description

setWebsite

public void setWebsite(String website)
Set plugin website.

Parameters: website the plugin website

FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.