Class PackageScanUtils

java.lang.Object
com.ultikits.ultitools.utils.PackageScanUtils

public class PackageScanUtils extends Object
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.
包扫描和类发现操作的实用工具类。 提供扫描包并查找带有特定注解的类的方法。 使用 Google Guava 的 ClassPath 进行高效的类扫描。
Since:
6.0.0
Author:
wisdomme
See Also:
  • ClassPath
  • 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 for
      要搜索的目标注解类
      packageName - the package name to scan
      要扫描的包名
      classLoader - the class loader to use for scanning
      用于扫描的类加载器
      Returns:
      a set of classes annotated with the target annotation
      带有目标注解的类集合