getAnnotation

fun KSAnnotated.getAnnotation(fqn: String): KSAnnotation?

Returns the first KSAnnotation on this declaration whose declaration FQN matches fqn, or null when no such annotation is present.

This is the primitive on top of which every other annotation query in this module is built, so that resolution logic (annotation type resolve + declaration FQN check) lives in one place.


inline fun <A : Annotation> KSAnnotated.getAnnotation(): KSAnnotation?

Returns the first KSAnnotation on this declaration of type A, or null when absent.