addAnnotation

open override fun addAnnotation(annotationSpec: AnnotationSpec): FileSpec.Builder

Add an annotation to the file.

The annotation must either have a file use-site target or not have a use-site target specified (in which case it will be changed to file).


open override fun addAnnotation(annotation: ClassName): FileSpec.Builder
@DelicateKotlinPoetApi(message = "Java reflection APIs don't give complete information on Kotlin types. Consider using the kotlinpoet-metadata APIs instead.")
open override fun addAnnotation(annotation: <Error class: unknown class><out <Error class: unknown class>>): FileSpec.Builder
open override fun addAnnotation(annotation: KClass<*>): FileSpec.Builder