class FindClasses
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.lang.ClassLoader |
cl |
private java.util.jar.JarFile[] |
jarFiles |
| Constructor and Description |
|---|
FindClasses(java.io.File... jars) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Collection<java.lang.Class> |
findExtends(java.lang.Class<?> clazz)
Find useful concrete (ie: not anonymous, not abstract, not an interface)
classes that extend clazz
|
java.util.Map<java.lang.Class,java.lang.Class> |
findMethodReturns(java.util.Collection<java.lang.Class> clazzes,
java.lang.String methodName,
java.lang.Class... parameterTypes)
Given a collection of classes, returns a Map containing the
subset of those classes that impliment the method specified,
where the value in the map is the return type of the method
|
java.lang.ClassLoader |
getClassLoader()
returns a class loader that includes the jar used to
construct this instance
|
static void |
main(java.lang.String[] args)
Simple command line test method
|
public FindClasses(java.io.File... jars)
throws java.io.IOException
java.io.IOExceptionpublic static void main(java.lang.String[] args)
throws java.lang.ClassNotFoundException,
java.io.IOException,
java.lang.NoSuchMethodException
java.lang.ClassNotFoundExceptionjava.io.IOExceptionjava.lang.NoSuchMethodExceptionpublic java.lang.ClassLoader getClassLoader()
public java.util.Collection<java.lang.Class> findExtends(java.lang.Class<?> clazz)
throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundExceptionpublic java.util.Map<java.lang.Class,java.lang.Class> findMethodReturns(java.util.Collection<java.lang.Class> clazzes,
java.lang.String methodName,
java.lang.Class... parameterTypes)
throws java.lang.NoSuchMethodException
java.lang.NoSuchMethodException