Package org.qiunet.utils.scanner
Class ClassScanner
java.lang.Object
org.qiunet.utils.scanner.ClassScanner
- All Implemented Interfaces:
IApplicationContext
- Author:
- qiunet Created on 17/1/23 18:22.
-
Method Summary
Modifier and TypeMethodDescription<T> ClassScanneraddParam(ArgumentKey<T> argKey, T obj) 添加一些参数给applicationContextgetFieldsAnnotatedWith(Class<? extends Annotation> annotation) get all fields annotated with a given annotationstatic ClassScannergetInstance(ScannerType... scannerType) getInstanceOfClass(Class clazz, Object... params) 返回class的对象 可以是自身持有对象的单例 没有就new 一个.getMethodsAnnotatedWith(Class<? extends Annotation> annotation) get all methods annotated with a given annotationgetSubTypesOf(Class<T> type) gets all sub types in hierarchy of a given typegetTypesAnnotatedWith(Class<? extends Annotation> annotation) get types annotated with a given annotation, both classes and annotationsbooleanisPrepare(ScannerType scannerType) 是否有扫描 scannerTypevoid
-
Method Details
-
getInstance
-
scanner
-
addParam
添加一些参数给applicationContext- Type Parameters:
T-- Parameters:
argKey-obj-- Returns:
-
getSubTypesOf
Description copied from interface:IApplicationContextgets all sub types in hierarchy of a given type depends on SubTypesScanner configured- Specified by:
getSubTypesOfin interfaceIApplicationContext
-
getTypesAnnotatedWith
Description copied from interface:IApplicationContextget types annotated with a given annotation, both classes and annotationsInheritedis not honored by default.when honoring @Inherited, meta-annotation should only effect annotated super classes and its sub types
Note that this (@Inherited) meta-annotation type has no effect if the annotated type is used for anything other then a class. Also, this meta-annotation causes annotations to be inherited only from superclasses; annotations on implemented interfaces have no effect.
depends on TypeAnnotationsScanner and SubTypesScanner configured- Specified by:
getTypesAnnotatedWithin interfaceIApplicationContext
-
getFieldsAnnotatedWith
Description copied from interface:IApplicationContextget all fields annotated with a given annotation depends on FieldAnnotationsScanner configured- Specified by:
getFieldsAnnotatedWithin interfaceIApplicationContext
-
getMethodsAnnotatedWith
Description copied from interface:IApplicationContextget all methods annotated with a given annotation depends on MethodAnnotationsScanner configured- Specified by:
getMethodsAnnotatedWithin interfaceIApplicationContext
-
isPrepare
Description copied from interface:IApplicationContext是否有扫描 scannerType- Specified by:
isPreparein interfaceIApplicationContext- Returns:
-
getInstanceOfClass
Description copied from interface:IApplicationContext返回class的对象 可以是自身持有对象的单例 没有就new 一个.- Specified by:
getInstanceOfClassin interfaceIApplicationContext- Returns:
-