AbstractModule.java 文件源码

java
阅读 36 收藏 0 点赞 0 评论 0

项目:vertx-jspare 作者:
/**
 * Execute one hook if is present.
 *
 * @param ann     the annotation
 * @param execute the handler
 * @param <T>     the type
 */
protected <T> void doHookIfPresent(Class<T> ann, Handler<T> execute) {

  Class<? extends Annotation> annClass = (Class<? extends Annotation>) ann;
  Target target = annClass.getAnnotation(Target.class);

  if (isCheckType(target, ElementType.TYPE)) {
    executeHookType(annClass, (a, t) -> execute.handle((T) t));
  }

  if (isCheckType(target, ElementType.METHOD)) {
    executeHookMethods(annClass, (a, t) -> execute.handle((T) t));
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号