org.reflections.scanners.TypeAnnotationsScanner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rapidpm-dynamic-cdi Show documentation
Show all versions of rapidpm-dynamic-cdi Show documentation
Dynamic Dependency Injection with different ways to manage the resolver-strategy
package org.reflections.scanners;
import java.lang.annotation.Inherited;
import java.util.List;
/** scans for class's annotations, where @Retention(RetentionPolicy.RUNTIME) */
@SuppressWarnings({"unchecked"})
public class TypeAnnotationsScanner extends AbstractScanner {
public void scan(final Object cls) {
final String className = getMetadataAdapter().getClassName(cls);
for (String annotationType : (List) getMetadataAdapter().getClassAnnotationNames(cls)) {
if (acceptResult(annotationType) ||
annotationType.equals(Inherited.class.getName())) { //as an exception, accept Inherited as well
getStore().put(annotationType, className);
}
}
}
}