public final class ClassFinder extends Object
Modifier and Type | Method and Description |
---|---|
static <T> List<Class<? extends T>> |
findSubTypes(Class<T> superClass)
Finds the names of all subtypes of the super class,
scanning the roots of this class classpath.
|
static <T> List<Class<? extends T>> |
findSubTypes(Class<T> superClass,
Predicate<String> predicate)
Finds the names of all subtypes of the super class,
scanning the roots of this class classpath.
|
static <T> List<Class<? extends T>> |
findSubTypes(File file,
Class<T> superClass)
Finds the names of all subtypes of the super class for the
supplied
File . |
static <T> List<Class<? extends T>> |
findSubTypes(File file,
Class<T> superClass,
Predicate<String> predicate)
Finds the names of all subtypes of the super class for the
supplied
File . |
static <T> List<Class<? extends T>> |
findSubTypes(List<File> files,
Class<T> superClass)
Finds the names of all subtypes of the super class in list
of
File supplied. |
static <T> List<Class<? extends T>> |
findSubTypes(List<File> files,
Class<T> superClass,
Predicate<String> accept)
Finds the names of all subtypes of the super class in list
of
File supplied. |
public static <T> List<Class<? extends T>> findSubTypes(Class<T> superClass)
T
- super typesuperClass
- the class from which to find subtypespublic static <T> List<Class<? extends T>> findSubTypes(Class<T> superClass, Predicate<String> predicate)
T
- super typesuperClass
- the class from which to find subtypespredicate
- filter to keep classes testing true
public static <T> List<Class<? extends T>> findSubTypes(List<File> files, Class<T> superClass)
File
supplied.
This method is null-safe. If no classes are found,
an empty list will be returned.T
- super typefiles
- directories and/or JARs to scan for classessuperClass
- the class from which to find subtypespublic static <T> List<Class<? extends T>> findSubTypes(List<File> files, Class<T> superClass, Predicate<String> accept)
File
supplied.
This method is null-safe. If no classes are found,
an empty list will be returned.T
- super typefiles
- directories and/or JARs to scan for classessuperClass
- the class from which to find subtypesaccept
- filter to keep classes testing true
public static <T> List<Class<? extends T>> findSubTypes(File file, Class<T> superClass)
File
.
This method is null-safe. If no classes are found,
an empty list will be returned.
If the file is null or does not exists, or if it is not a JAR or
directory, an empty string list will be returned.T
- super typefile
- directory or JAR to scan for classessuperClass
- the class from which to find subtypespublic static <T> List<Class<? extends T>> findSubTypes(File file, Class<T> superClass, Predicate<String> predicate)
File
.
This method is null-safe. If no classes are found,
an empty list will be returned.
If the file is null or does not exists, or if it is not a JAR or
directory, an empty string list will be returned.T
- super typefile
- directory or JAR to scan for classessuperClass
- the class from which to find subtypespredicate
- filter to keep classes testing true
Copyright © 2008–2023 Norconex Inc.. All rights reserved.