@Override
public List<MaraAnnotationHandler> getHandlers() throws ToolException {
List<MaraAnnotationHandler> handlers = new ArrayList<>();
Reflections reflections = initReflections(getBasePackagesToScanForComponents());
Set<Class<?>> handlerClasses = reflections.getTypesAnnotatedWith(Service.class);
for (Class<?> handlerClass : handlerClasses) {
if (MaraAnnotationHandler.class.isAssignableFrom(handlerClass)) {
try {
MaraAnnotationHandler handler = (MaraAnnotationHandler) handlerClass.newInstance();
handlers.add(handler);
} catch (InstantiationException | IllegalAccessException e) {
throw new ToolException(e);
}
}
}
return handlers;
}
ReflectionAnnotationHandlerProvider.java 文件源码
java
阅读 18
收藏 0
点赞 0
评论 0
项目:mara
作者:
评论列表
文章目录