Skip to content

KotlinJavaModuleJavaAnnotationsProvider

Directly provides JavaAnnotations, which is the representation that the Kotlin compiler expects internally. However, JavaAnnotation is a compiler-internal API, so this provider should only be preferred if the implementation directly accesses JavaAnnotations.

Functions

getAnnotationsForModuleOwnerOfClass

abstract fun getAnnotationsForModuleOwnerOfClass(classId: ClassId): List<T>?

Returns all annotations of the Java module where the class with the given classId is defined.

Example

// module-info.java
@MyAnnotation
module myModule {
}

// MyClass.java
package myModule

public class MyClass {
}

Here, when given myModule.MyClass, getAnnotationsForModuleOwnerOfClass should return @MyAnnotation.