ProcessorAnnotation

@ProcessorAnnotation(packageName = "dev.kord.codegen.ksp.processor")
annotation class ProcessorAnnotation(val packageName: String)(source)

This annotation instructs the processor to generate a data class wrapper around the annotation with factory functions to instantiate it from a KSAnnotation.

Type mappings

KSP does not represent all types identical to the ones in the actual annotation, please use the mapping below

Annotation typeWrapper type
Primitives and Stringssame as in annotation
ArrayList
KClassKSType
AnnotationTypeKSAnnotation or another wrapper if available

Factory function

In order to obtain an instance of the wrapper type, please use the generated constructor function which takes an KSAnnotation

Obtaining the annotations from KSAnnotated

If the Annotation is annotated with Repeatable use the generated KSAnnotated.getAnnotationNames function otherwise use the generated KSAnnotated.getAnnotationName function

Nullables

If you want to make a property in the wrapper type nullable annotate it with NullIfDefault and set it's default value to some magic value

Properties

Link copied to clipboard