Skip to content

KotlinJavaModuleAnnotationsProvider

Provides annotations for Java modules.

The platform must define one of the following annotation providers:

Inheritors

Types

Companion

object Companion

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.