public class

ClassFinder

extends Object
java.lang.Object
   ↳ com.microstrategy.utils.ClassFinder

Class Overview

This ia a utility class for finding classes.

Summary

Public Constructors
ClassFinder()
Public Methods
static Set findClasses(String packStr, Class baseClass)
Finds all classes available in the CLASSPATH that belong to specified set of packages and are type-compatible with specified class baseClass.
static Set findClasses(String clPath, String packStr, Class baseClass)
Finds all classes available in the clPath classpas that belong to specified set of packages and are type-compatible with specified class baseClass.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ClassFinder ()

Public Methods

public static Set findClasses (String packStr, Class baseClass)

Finds all classes available in the CLASSPATH that belong to specified set of packages and are type-compatible with specified class baseClass. If baseClass is a class then all returned classes shall be its subclasses. If baseClass is an interface then all returned classes shall implement it. The method accepts only concrete classes. All interfaces and abstract classes are ignored.

Parameters
packStr a string containing semicolon separated list of Java packages where to look for classes
baseClass a base class or interface. If baseClass is a class then all returned classes shall be its subclasses. If baseClass is an interface then all returned classes shall implement it.
Returns
  • a set of Class objects

public static Set findClasses (String clPath, String packStr, Class baseClass)

Finds all classes available in the clPath classpas that belong to specified set of packages and are type-compatible with specified class baseClass. If baseClass is a class then all returned classes shall be its subclasses. If baseClass is an interface then all returned classes shall implement it. The method accepts only concrete classes. All interfaces and abstract classes are ignored.

Parameters
clPath a classpath where to look for classes.
packStr a string containing semicolon separated list of Java packages where to look for classes
baseClass a base class or interface. If baseClass is a class then all returned classes shall be its subclasses. If baseClass is an interface then all returned classes shall implement it.
Returns
  • a set of Class objects