org.reflections.Store.getTypesAnnotatedWith()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(154)

本文整理了Java中org.reflections.Store.getTypesAnnotatedWith()方法的一些代码示例,展示了Store.getTypesAnnotatedWith()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Store.getTypesAnnotatedWith()方法的具体详情如下:
包路径:org.reflections.Store
类名称:Store
方法名:getTypesAnnotatedWith

Store.getTypesAnnotatedWith介绍

暂无

代码示例

代码示例来源:origin: org.apache.brooklyn/brooklyn-core

/** overrides delegate so as to log rather than throw exception if a class cannot be loaded */
public Set<Class<?>> getTypesAnnotatedWith(Class<? extends Annotation> annotation) {
  Set<String> annotatedWith = getStore().getTypesAnnotatedWith(annotation.getName());
  return ImmutableSet.copyOf(this.forNames(annotatedWith, "annotated "+annotation.getName()));
}

代码示例来源:origin: io.brooklyn/brooklyn-core

/** overrides delegate so as to log rather than throw exception if a class cannot be loaded */
public Set<Class<?>> getTypesAnnotatedWith(Class<? extends Annotation> annotation) {
  Set<String> annotatedWith = getStore().getTypesAnnotatedWith(annotation.getName());
  return ImmutableSet.copyOf(this.forNames(annotatedWith, "annotated "+annotation.getName()));
}

代码示例来源:origin: play/play-java

/**
 * Scans the application classloader to retrieve all types annotated with a specific annotation.
 * <p>
 * This method is useful for some plug-ins, for example the EBean plugin will automatically detect all types
 * annotated with <code>@javax.persistance.Entity</code>.
 * <p>
 * Note that it is better to specify a very specific package to avoid expensive searches.
 *
 * @param packageName the root package to scan
 * @param annotation annotation class
 * @return a set of types names statifying the condition
 */
public static Set<String> getTypesAnnotatedWith(Application app, String packageName, Class<? extends java.lang.annotation.Annotation> annotation) {
  return getReflections(app, packageName).getStore().getTypesAnnotatedWith(annotation.getName());
}

相关文章