/** 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())); }
/** 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())); }
/** * 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()); }