edu.umd.cs.findbugs.ba

Class URLClassPathRepository

public class URLClassPathRepository extends Object implements Repository

BCEL Repository implementation that uses an URLClassPath to find classes. This class has two specific improvements over BCEL's SyntheticRepository class:
  1. Classpath elements may be added at any time, not just when the object is created.
  2. Classpath elements can be URLs. This allows repository lookups to find classes via http URLs, jar URLs, etc.
FindBugs requires and uses both of these capabilities.

Author: David Hovemeyer

Field Summary
static booleanDEBUG
Constructor Summary
URLClassPathRepository()
Method Summary
voidaddURL(String fileName)
Add a filename or URL to the classpath.
voidclear()
voiddestroy()
Clear the repository and close all underlying resources.
JavaClassfindClass(String className)
ClassPathgetClassPath()
JavaClassloadClass(String className)
JavaClassloadClass(Class clazz)
voidremoveClass(JavaClass javaClass)
voidstoreClass(JavaClass javaClass)

Field Detail

DEBUG

public static final boolean DEBUG

Constructor Detail

URLClassPathRepository

public URLClassPathRepository()

Method Detail

addURL

public void addURL(String fileName)
Add a filename or URL to the classpath.

Parameters: fileName filename or URL of classpath entry to add

Throws: IOException

clear

public void clear()

destroy

public void destroy()
Clear the repository and close all underlying resources.

findClass

public JavaClass findClass(String className)

getClassPath

public ClassPath getClassPath()

loadClass

public JavaClass loadClass(String className)

loadClass

public JavaClass loadClass(Class clazz)

removeClass

public void removeClass(JavaClass javaClass)

storeClass

public void storeClass(JavaClass javaClass)
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.