Package com.ultikits.ultitools.utils
Class PackageScanUtils
java.lang.Object
com.ultikits.ultitools.utils.PackageScanUtils
Utility class for package scanning and class discovery operations.
Provides methods to scan packages and find classes with specific annotations.
Uses Google Guava's ClassPath for efficient class scanning.
- Since:
- 6.0.0
- Author:
- wisdomme
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionscanAnnotatedClasses(Class<? extends Annotation> targetAnnotation, String packageName, ClassLoader classLoader) Scan for classes annotated with a specific annotation in a given package.
-
Constructor Details
-
PackageScanUtils
public PackageScanUtils()
-
-
Method Details
-
scanAnnotatedClasses
public static Set<Class<?>> scanAnnotatedClasses(Class<? extends Annotation> targetAnnotation, String packageName, ClassLoader classLoader) Scan for classes annotated with a specific annotation in a given package. This method recursively scans all classes in the specified package and its sub-packages.- Parameters:
targetAnnotation- the target annotation class to search forpackageName- the package name to scanclassLoader- the class loader to use for scanning- Returns:
- a set of classes annotated with the target annotation
-