Mp3dings 
20100427

de.mospace.lang
Class RTSI

java.lang.Object
  extended by de.mospace.lang.RTSI

public class RTSI
extends Object

This utility class is looking for all the public classes implementing or inheriting from a given interface or class that can be instantiated with a zero-argument constructor. (RunTime Subclass Identification)

Version:
1.0 [MR] find(String,Class) returns array with class names instead of printing to stdout. [MR] Using URIs to look up resources (previous version did not work when there was a blank in the file name) [MR] specify class loader to use [MR] optionally use properties cache
Author:
Daniel Le Berre

Constructor Summary
RTSI()
           
RTSI(ClassLoader cl)
           
 
Method Summary
static void addLogHandler(Handler lh)
           
static ClassLoader createLibClassLoader(File libdir)
          deprecated use a ClassLoaderProvider instead
static ClassLoader createLibClassLoader(File[] libdir)
          deprecated use a ClassLoaderProvider instead
 void find(String tosubclassname)
          Display all the classes inheriting or implementing a given class in the currently loaded packages.
 String[] find(String pckgname, Class tosubclass)
          Display all the classes inheriting or implementing a given class in a given package.
 String[] find(String pckname, Class tosubclass, File configdir, String buildprop, String buildval)
          property cache
 String[] find(String pckname, Class tosubclass, Preferences pref, String buildprop, String buildval)
          pref cache
 void find(String pckname, String tosubclassname)
          Display all the classes inheriting or implementing a given class in a given package.
 ClassLoader getClassLoader()
           
 void main(String[] args)
           
 boolean testClass(String classname, Class tosubclass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RTSI

public RTSI()

RTSI

public RTSI(ClassLoader cl)
Method Detail

createLibClassLoader

public static ClassLoader createLibClassLoader(File libdir)
deprecated use a ClassLoaderProvider instead


createLibClassLoader

public static ClassLoader createLibClassLoader(File[] libdir)
deprecated use a ClassLoaderProvider instead


getClassLoader

public ClassLoader getClassLoader()

addLogHandler

public static void addLogHandler(Handler lh)

find

public void find(String tosubclassname)
Display all the classes inheriting or implementing a given class in the currently loaded packages. Works only with the default class loader!!!

Parameters:
tosubclassname - the name of the class to inherit from

find

public void find(String pckname,
                 String tosubclassname)
Display all the classes inheriting or implementing a given class in a given package.

Parameters:
pckname - the fully qualified name of the package
tosubclassname - the name of the class to inherit from

find

public String[] find(String pckname,
                     Class tosubclass,
                     Preferences pref,
                     String buildprop,
                     String buildval)
pref cache


find

public String[] find(String pckname,
                     Class tosubclass,
                     File configdir,
                     String buildprop,
                     String buildval)
property cache


find

public String[] find(String pckgname,
                     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
tosubclass - the Class object to inherit from

main

public void main(String[] args)

testClass

public boolean testClass(String classname,
                         Class tosubclass)

Mp3dings 
20100427