Package edu.umd.cs.findbugs
Class PluginLoader
- java.lang.Object
-
- edu.umd.cs.findbugs.PluginLoader
-
public class PluginLoader extends java.lang.Object
Loader for a FindBugs plugin. A plugin is a jar file containing two metadata files, "findbugs.xml" and "messages.xml". Those files specify- the bug pattern Detector classes,
- the bug patterns detected (including all text for displaying detected instances of those patterns), and
- the "bug codes" which group together related bug instances
The PluginLoader creates a Plugin object to store the Detector factories and metadata.
- Author:
- David Hovemeyer
- See Also:
Plugin
,PluginException
-
-
Constructor Summary
Constructors Constructor Description PluginLoader()
Constructor.PluginLoader(java.net.URL url)
Constructor.PluginLoader(java.net.URL url, java.lang.ClassLoader parent)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ClassLoader
getClassLoader()
static java.net.URL
getCoreResource(java.lang.String name)
Plugin
getPlugin()
Get the Plugin.boolean
isCorePlugin()
static java.net.URL
loadFromFindBugsEtcDir(java.lang.String name)
static java.net.URL
loadFromFindBugsPluginDir(java.lang.String name)
-
-
-
Constructor Detail
-
PluginLoader
public PluginLoader(java.net.URL url) throws PluginException
Constructor.- Parameters:
url
- the URL of the plugin Jar file- Throws:
PluginException
- if the plugin cannot be fully loaded
-
PluginLoader
public PluginLoader(java.net.URL url, java.lang.ClassLoader parent) throws PluginException
Constructor.- Parameters:
url
- the URL of the plugin Jar fileparent
- the parent classloader- Throws:
PluginException
-
PluginLoader
public PluginLoader()
Constructor. Loads a plugin using the caller's class loader. This constructor should only be used to load the "core" findbugs detectors, which are built into findbugs.jar.
-
-
Method Detail
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
- Returns:
- Returns the classLoader.
-
getPlugin
public Plugin getPlugin() throws PluginException
Get the Plugin.- Throws:
PluginException
- if the plugin cannot be fully loaded
-
getCoreResource
@CheckForNull public static java.net.URL getCoreResource(java.lang.String name)
-
loadFromFindBugsEtcDir
@CheckForNull public static java.net.URL loadFromFindBugsEtcDir(java.lang.String name)
-
loadFromFindBugsPluginDir
@CheckForNull public static java.net.URL loadFromFindBugsPluginDir(java.lang.String name)
-
isCorePlugin
public boolean isCorePlugin()
-
-