如何建立与我的自定义注解类的列表? [英] How to build a list of classes annotated with my custom annotation?
本文介绍了如何建立与我的自定义注解类的列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在其中标注了 @Custom
注释应用类的完整列表。此操作的最好的机制是什么?
I want to get a complete list of classes in the application which are annotated with @Custom
annotation. What is the best mechanism for this operation?
PS。例如,如何JAX-RS实现发现被标注了 @Path
所有类?我想用同样的机制。
ps. For example, how JAX-RS implementations find all classes that are annotated with @Path
? I would like to use the same mechanism.
推荐答案
谷歌搜索的Classpath扫描收益率:
Googling for "classpath scanning" yields:
HTTP://$c$c.google.com/p/reflections/
这篇关于如何建立与我的自定义注解类的列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文