-
- All Implemented Interfaces:
public class ClassPathScanHandler
-
-
Constructor Summary
Constructors Constructor Description ClassPathScanHandler(Array<String> scanPackages)the classes and the scanPackages to be scanned. ClassPathScanHandler(Boolean excludeInner, Boolean checkInOrEx, List<String> classFilters)excludeInner: 是否排除内部类 true 是 false 否 checkInOrEx: 过滤规则适用情况 true: 搜索符合规则的 false: 排除符合规则的 classFilters: 自定义过滤规则,如果是null或者空,即全部符合不过滤
-
Method Summary
Modifier and Type Method Description Set<Class<out Object>>getAllClassesWithAnnotation(Class<out Annotation> annotation, boolean honorInherited)get all the classes with annotation. <T> Set<Class<out T>>getAllSubClassesByParent(Class<T> parent)get all the sub classes with the specific parent class. Set<Class<out Object>>getPackageAllClasses(String basePackage, boolean recursive)scan the package. -
-
Constructor Detail
-
ClassPathScanHandler
ClassPathScanHandler(Array<String> scanPackages)
the classes and the scanPackages to be scanned.- Parameters:
scanPackages- scanPackages.
-
ClassPathScanHandler
ClassPathScanHandler(Boolean excludeInner, Boolean checkInOrEx, List<String> classFilters)
excludeInner: 是否排除内部类 true 是 false 否 checkInOrEx: 过滤规则适用情况 true: 搜索符合规则的 false: 排除符合规则的 classFilters: 自定义过滤规则,如果是null或者空,即全部符合不过滤- Parameters:
excludeInner- whether exclude the inner class.checkInOrEx- whether exclude the rule checking.classFilters- the customized the classes to be filtered.
-
-
Method Detail
-
getAllClassesWithAnnotation
Set<Class<out Object>> getAllClassesWithAnnotation(Class<out Annotation> annotation, boolean honorInherited)
get all the classes with annotation.
- Parameters:
annotation- the specific annotation.honorInherited- honorInherited
-
getAllSubClassesByParent
<T> Set<Class<out T>> getAllSubClassesByParent(Class<T> parent)
get all the sub classes with the specific parent class.
- Parameters:
parent- the parent class.
-
getPackageAllClasses
Set<Class<out Object>> getPackageAllClasses(String basePackage, boolean recursive)
scan the package.
- Parameters:
basePackage- the basic class package's string.recursive- whether to search recursive.
-
-
-
-