AnnotationScanner
Utility object for scanning annotations on Kotlin reflection elements. Provides methods to find annotations that are inherited from parent classes, interfaces, or overridden members, not just directly declared annotations.
This scanner uses MergedAnnotation to collect annotations from the entire inheritance hierarchy, making it useful for frameworks that need to discover annotations from base classes or interfaces.
Functions
Scans for the first annotation of the specified reified type on the annotated element. This is a convenience method that uses reified generics to avoid specifying the class explicitly.
Scans for the first annotation of the specified type on the annotated element. Returns null if no matching annotation is found.
Scans for all annotations of the specified reified type on the annotated element. This is a convenience method that uses reified generics to avoid specifying the class explicitly.
Scans for all annotations of the specified type on the annotated element, including inherited annotations from parent classes and interfaces.