Package org.qiunet.utils.scanner
Interface IApplicationContext
- All Known Implementing Classes:
ClassScanner
public interface IApplicationContext
-
Method Summary
Modifier and TypeMethodDescriptiongetFieldsAnnotatedWith(Class<? extends Annotation> annotation) get all fields annotated with a given annotationgetInstanceOfClass(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) 是否有扫描 scannerType
-
Method Details
-
getSubTypesOf
gets all sub types in hierarchy of a given type depends on SubTypesScanner configured -
getTypesAnnotatedWith
get 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 -
getFieldsAnnotatedWith
get all fields annotated with a given annotation depends on FieldAnnotationsScanner configured -
getMethodsAnnotatedWith
get all methods annotated with a given annotation depends on MethodAnnotationsScanner configured -
getInstanceOfClass
返回class的对象 可以是自身持有对象的单例 没有就new 一个.- Parameters:
clazz-- Returns:
-
isPrepare
是否有扫描 scannerType- Parameters:
scannerType-- Returns:
-