elge.engine
Class ClassSearcher

java.lang.Object
  |
  +--elge.engine.ClassSearcher

public class ClassSearcher
extends Object

Searches the packages, jar files or files on disk for instances of some class.

This class was modified from source as described in the source of this class.

Author:
Pavol Žibrita

Field Summary
protected static String[] skipPackages
          packages to skip
 
Method Summary
static Set find(String tosubclassname)
          Returns all the classes inheriting or implementing a given class in the currently loaded packages.
static Set find(String pckgname, String clsname, Class tosubclass)
          Display all the classes inheriting or implementing a given class in a given package.
static Set find(String pckname, String clsname, String tosubclassname)
          Returns all the classes inheriting or implementing a given class in a given package.
protected static boolean skipPackage(String pname)
          Tests if the package name is in the skip packages array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

skipPackages

protected static final String[] skipPackages
packages to skip

Method Detail

skipPackage

protected static boolean skipPackage(String pname)
Tests if the package name is in the skip packages array. Returns true if yes.

Parameters:
pname - the package name to test
Returns:
true if the package should be skipped.

find

public static Set find(String tosubclassname)
Returns all the classes inheriting or implementing a given class in the currently loaded packages.

Parameters:
tosubclassname - the name of the class to inherit from
Returns:
Sets of Class objects or null, if the param is not a valid class name.

find

public static Set find(String pckname,
                       String clsname,
                       String tosubclassname)
Returns all the classes inheriting or implementing a given class in a given package.

Parameters:
pckname - the package to search in.
clsname - The class in a package where to search.
tosubclassname - the subclass to search isntances of
Returns:
Set of Class objects or null if the subclass name is not a valid class.

find

public static Set find(String pckgname,
                       String clsname,
                       Class tosubclass)
Display all the classes inheriting or implementing a given class in a given package.

Parameters:
pckgname - the fully qualified name of the package
clsname - a class in package where to search.
tosubclass - the Class object to inherit from
Returns:
Set of Class objects or null.