Package net.thucydides.core.reflection
Class ClassFinder
java.lang.Object
net.thucydides.core.reflection.ClassFinder
public class ClassFinder
extends java.lang.Object
Load classes from a given package.
-
Method Summary
Modifier and Type Method Description ClassFinderannotatedWith(java.lang.Class annotation)java.util.List<java.lang.Class<?>>fromPackage(java.lang.String packageName)Scans all classes accessible from the context class loader which belong to the given package and subpackages.static java.util.List<java.lang.Class<?>>getClasses(java.lang.String packageName)Scans all classes accessible from the context class loader which belong to the given package and subpackages.static ClassFinderloadClasses()ClassFinderthatImplement(java.lang.Class<?> parentInterface)ClassFinderthatMatch(java.util.function.Predicate<java.lang.Class> condition)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
loadClasses
-
annotatedWith
-
fromPackage
public java.util.List<java.lang.Class<?>> fromPackage(java.lang.String packageName)Scans all classes accessible from the context class loader which belong to the given package and subpackages.- Parameters:
packageName- The base package- Returns:
- The classes
-
getClasses
public static java.util.List<java.lang.Class<?>> getClasses(java.lang.String packageName)Scans all classes accessible from the context class loader which belong to the given package and subpackages. Adapted from http://snippets.dzone.com/posts/show/4831 and extended to support use of JAR files- Parameters:
packageName- The base package- Returns:
- The classes
-
thatImplement
-
thatMatch
-