Scala如何获得带注释的类

时间:2016-01-05 11:44:38

标签: scala annotations scala-reflect

在Java中,我可以使用org.reflections来扫描包和搜索带注释的类。

像这样:

Reflections ref = new Reflections("my.path");
Set<Class<?>> set = ref.getTypesAnnotatedWith(MyAnnotation.class);

如何在scala中获取带注释的类?我使用scala 2.11scala-reflect

P.S。 org.reflections在scala中运行良好,但我搜索原生乐器。

0 个答案:

没有答案
相关问题