public final class ClassFinder
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.util.List<java.lang.String> |
findAnnotatedClasses(java.lang.String[] strPathsOrJars,
java.lang.Class<? extends java.lang.annotation.Annotation>[] annotations)
Find classes in the provided path(s)/jar(s) that extend the class(es).
|
static java.util.List<java.lang.String> |
findAnnotatedClasses(java.lang.String[] strPathsOrJars,
java.lang.Class<? extends java.lang.annotation.Annotation>[] annotations,
boolean innerClasses)
Find classes in the provided path(s)/jar(s) that extend the class(es).
|
static java.util.List<java.lang.String> |
findClasses(java.lang.String[] searchPathsOrJars,
ClassFilter filter)
Find all classes in the given jars that passes the class filter.
|
static java.util.List<java.lang.String> |
findClassesThatExtend(java.lang.String[] paths,
java.lang.Class<?>[] superClasses)
Convenience method for
findClassesThatExtend(String[], Class[], boolean) with the
option to include inner classes in the search set to false. |
static java.util.List<java.lang.String> |
findClassesThatExtend(java.lang.String[] strPathsOrJars,
java.lang.Class<?>[] superClasses,
boolean innerClasses)
Find classes in the provided path(s)/jar(s) that extend the class(es).
|
static java.util.List<java.lang.String> |
findClassesThatExtend(java.lang.String[] strPathsOrJars,
java.lang.Class<?>[] superClasses,
boolean innerClasses,
java.lang.String contains,
java.lang.String notContains)
Find classes in the provided path(s)/jar(s) that extend the class(es).
|
static java.util.List<java.lang.String> |
findClassesThatExtend(java.lang.String[] searchPathsOrJars,
java.lang.Class<?>[] classNames,
boolean innerClasses,
java.lang.String contains,
java.lang.String notContains,
boolean annotations)
Find classes in the provided path(s)/jar(s) that extend the class(es).
|
public static java.util.List<java.lang.String> findClassesThatExtend(java.lang.String[] paths, java.lang.Class<?>[] superClasses) throws java.io.IOException
findClassesThatExtend(String[], Class[], boolean)
with the
option to include inner classes in the search set to false.paths
- pathnames or jarfiles to search for classessuperClasses
- required parent class(es)java.io.IOException
- when scanning the classes failspublic static java.util.List<java.lang.String> findClassesThatExtend(java.lang.String[] strPathsOrJars, java.lang.Class<?>[] superClasses, boolean innerClasses) throws java.io.IOException
strPathsOrJars
- pathnames or jarfiles to search for classessuperClasses
- required parent class(es)innerClasses
- should we include inner classes?java.io.IOException
- when scanning for classes failspublic static java.util.List<java.lang.String> findClassesThatExtend(java.lang.String[] strPathsOrJars, java.lang.Class<?>[] superClasses, boolean innerClasses, java.lang.String contains, java.lang.String notContains) throws java.io.IOException
strPathsOrJars
- pathnames or jarfiles to search for classessuperClasses
- required parent class(es)innerClasses
- should we include inner classes?contains
- classname should contain this stringnotContains
- classname should not contain this stringjava.io.IOException
- when scanning classes failspublic static java.util.List<java.lang.String> findAnnotatedClasses(java.lang.String[] strPathsOrJars, java.lang.Class<? extends java.lang.annotation.Annotation>[] annotations, boolean innerClasses) throws java.io.IOException
strPathsOrJars
- pathnames or jarfiles to search for classesannotations
- required annotationsinnerClasses
- should we include inner classes?java.io.IOException
- when scanning classes failspublic static java.util.List<java.lang.String> findAnnotatedClasses(java.lang.String[] strPathsOrJars, java.lang.Class<? extends java.lang.annotation.Annotation>[] annotations) throws java.io.IOException
strPathsOrJars
- pathnames or jarfiles to search for classesannotations
- required annotationsjava.io.IOException
- when scanning classes failspublic static java.util.List<java.lang.String> findClassesThatExtend(java.lang.String[] searchPathsOrJars, java.lang.Class<?>[] classNames, boolean innerClasses, java.lang.String contains, java.lang.String notContains, boolean annotations) throws java.io.IOException
searchPathsOrJars
- pathnames or jarfiles to search for classesclassNames
- required parent class(es) or annotationsinnerClasses
- should we include inner classes?contains
- classname should contain this stringnotContains
- classname should not contain this stringannotations
- true if classnames are annotationsjava.io.IOException
- when scanning classes failspublic static java.util.List<java.lang.String> findClasses(java.lang.String[] searchPathsOrJars, ClassFilter filter) throws java.io.IOException
searchPathsOrJars
- list of strings representing the jar locationsfilter
- ClassFilter
that the classes in the jars should
conform tofilter
java.io.IOException
- when reading the jar files failsCopyright © 1998-2019 Apache Software Foundation. All Rights Reserved.