edu.umd.cs.findbugs
Class PluginLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
edu.umd.cs.findbugs.PluginLoader
public class PluginLoader
- extends java.net.URLClassLoader
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 |
PluginLoader(java.net.URL url)
Constructor. |
PluginLoader(java.net.URL url,
java.lang.ClassLoader parent)
Constructor. |
Method Summary |
private void |
addCollection(java.util.List<org.dom4j.Document> messageCollectionList,
java.lang.String filename)
|
private static org.dom4j.Node |
findMessageNode(java.util.List<org.dom4j.Document> messageCollectionList,
java.lang.String xpath,
java.lang.String missingMsg)
|
private static java.lang.String |
getChildText(org.dom4j.Node node,
java.lang.String childName)
|
Plugin |
getPlugin()
Get the Plugin. |
private void |
init()
|
private java.lang.String |
lookupDetectorClass(Plugin plugin,
java.lang.String name)
|
Methods inherited from class java.net.URLClassLoader |
addURL, definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstance |
Methods inherited from class java.security.SecureClassLoader |
defineClass, defineClass |
Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
nextUnknownId
private static int nextUnknownId
plugin
private Plugin plugin
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
getPlugin
public Plugin getPlugin()
throws PluginException
- Get the Plugin.
- Throws:
PluginException
- if the plugin cannot be fully loaded
init
private void init()
throws PluginException
- Throws:
PluginException
lookupDetectorClass
private java.lang.String lookupDetectorClass(Plugin plugin,
java.lang.String name)
throws PluginException
- Throws:
PluginException
addCollection
private void addCollection(java.util.List<org.dom4j.Document> messageCollectionList,
java.lang.String filename)
throws org.dom4j.DocumentException
- Throws:
org.dom4j.DocumentException
findMessageNode
private static org.dom4j.Node findMessageNode(java.util.List<org.dom4j.Document> messageCollectionList,
java.lang.String xpath,
java.lang.String missingMsg)
throws PluginException
- Throws:
PluginException
getChildText
private static java.lang.String getChildText(org.dom4j.Node node,
java.lang.String childName)
throws PluginException
- Throws:
PluginException