All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.reflections.scanners.TypeAnnotationsScanner Maven / Gradle / Ivy

There is a newer version: 1.1.1
Show newest version
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);
            }
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy