Package jade.util
Class ClassFinder
- java.lang.Object
-
- jade.util.ClassFinder
-
public class ClassFinder extends Object
This utility class was based originally on Daniel Le Berre'sRTSIclass. This class can be called in different modes, but the principal use is to determine what subclasses/implementations of a given class/interface exist in the current runtime environment.- Author:
- Daniel Le Berre, Elliott Wade, Paolo Cancedda
-
-
Constructor Summary
Constructors Constructor Description ClassFinder()ClassFinder(String[] jarNames)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VectorfindSubclasses(String fqcn)VectorfindSubclasses(String fqcn, ClassFinderListener aListener, ClassFinderFilter aFilter)MapgetClasspathLocations()Determine every URL location defined by the current classpath, and it's associated package name.ListgetErrors()URLgetLocationOf(Class<?> cls)The result of the last search is cached in this object, along with the URL that corresponds to each class returned.booleanisWorking()voidrefreshLocations()Rescan the classpath, cacheing all possible file locations.
-
-
-
Constructor Detail
-
ClassFinder
public ClassFinder()
-
ClassFinder
public ClassFinder(String[] jarNames)
-
-
Method Detail
-
isWorking
public boolean isWorking()
-
refreshLocations
public final void refreshLocations()
Rescan the classpath, cacheing all possible file locations.
-
findSubclasses
public final Vector findSubclasses(String fqcn, ClassFinderListener aListener, ClassFinderFilter aFilter)
- Parameters:
fqcn- Name of superclass/interface on which to search
-
getErrors
public final List getErrors()
-
getLocationOf
public final URL getLocationOf(Class<?> cls)
The result of the last search is cached in this object, along with the URL that corresponds to each class returned. This method may be called to query the cache for the location at which the given class was found.nullwill be returned if the given class was not found during the last search, or if the result cache has been cleared.
-
getClasspathLocations
public final Map getClasspathLocations()
Determine every URL location defined by the current classpath, and it's associated package name.
-
-