de.lmu.ifi.dbs.elki.utilities
Class InspectionUtil

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.utilities.InspectionUtil

public class InspectionUtil
extends Object

A collection of inspection-related utility functions.


Nested Class Summary
static class InspectionUtil.ClassSorter
          Sort classes by their class name.
(package private) static class InspectionUtil.DirClassIterator
          Class to iterate over a directory tree.
(package private) static class InspectionUtil.JarClassIterator
          Class to iterate over a Jar file.
 
Field Summary
private static WeakReference<List<Class<?>>> CLASS_CACHE
           
private static String[] DEFAULT_IGNORES
          Default package ignores.
static boolean NONSTATIC_CLASSPATH
          If we have a non-static classpath, we do more extensive scanning for user extensions.
 
Constructor Summary
InspectionUtil()
           
 
Method Summary
static List<Class<?>> cachedFindAllImplementations(Class<?> c)
          Cached version of "findAllImplementations".
static List<Class<?>> findAllImplementations(Class<?> c, boolean everything)
          Find all implementations of a given class in the classpath.
static List<Class<?>> findAllImplementations(String[] classpath, Class<?> c, String[] ignorepackages, boolean everything)
          Find all implementations of a given class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_IGNORES

private static final String[] DEFAULT_IGNORES
Default package ignores.


NONSTATIC_CLASSPATH

public static final boolean NONSTATIC_CLASSPATH
If we have a non-static classpath, we do more extensive scanning for user extensions.


CLASS_CACHE

private static WeakReference<List<Class<?>>> CLASS_CACHE
Constructor Detail

InspectionUtil

public InspectionUtil()
Method Detail

cachedFindAllImplementations

public static List<Class<?>> cachedFindAllImplementations(Class<?> c)
Cached version of "findAllImplementations". For Parameterizable classes only!

Parameters:
c - Class to scan for
Returns:
Found implementations

findAllImplementations

public static List<Class<?>> findAllImplementations(Class<?> c,
                                                    boolean everything)
Find all implementations of a given class in the classpath. Note: returned classes may be abstract.

Parameters:
c - Class restriction
everything - include interfaces, abstract and private classes
Returns:
List of found classes.

findAllImplementations

public static List<Class<?>> findAllImplementations(String[] classpath,
                                                    Class<?> c,
                                                    String[] ignorepackages,
                                                    boolean everything)
Find all implementations of a given class.

Parameters:
classpath - Classpath to use (JARs and folders supported)
c - Class restriction
ignorepackages - List of packages to ignore
everything - include interfaces, abstract and private classes
Returns:
List of found classes.

Release 0.4.0 (2011-09-20_1324)