ProcessorAnnotation
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 type | Wrapper type |
---|---|
Primitives and Strings | same as in annotation |
Array | List |
KClass | KSType |
AnnotationType | KSAnnotation 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