Package pulse.util
Class ReflexiveFinder
- java.lang.Object
-
- pulse.util.ReflexiveFinder
-
public class ReflexiveFinder extends Object
Provides utility methods for finding classes and instances ofReflexive
in aPULsE
package.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<Class<?>>
classesIn(String pckgname)
Uses Java Reflection API to find all classes within the package namedpckgname
.static <V extends Reflexive>
List<V>simpleInstances(String pckgname)
static <V extends Reflexive>
List<V>simpleInstances(String pckgname, Object... params)
Finds simple instances ofReflexive
subclasses withinpckgname
.
-
-
-
Method Detail
-
classesIn
public static List<Class<?>> classesIn(String pckgname)
Uses Java Reflection API to find all classes within the package namedpckgname
. Works well with .jar files.- Parameters:
pckgname
- the name of the package.- Returns:
- a list of
Class
objects.
-
simpleInstances
public static <V extends Reflexive> List<V> simpleInstances(String pckgname, Object... params)
Finds simple instances of
Reflexive
subclasses withinpckgname
. A simple instance is either one that results from invoking a no-argument constructor or agetInstance()
method.- Type Parameters:
V
- a class implementingReflexive
- Parameters:
pckgname
- the name of the package for the search- Returns:
- a list of classes implementing
Reflexive
that are found inpckgname
.
-
-