kotlinpoet / com.squareup.kotlinpoet / AnnotationSpec

AnnotationSpec

class AnnotationSpec : Taggable

A generated annotation on a declaration.

Types

Builder

class Builder : Taggable.Builder<AnnotationSpec.Builder>

UseSiteTarget

enum class UseSiteTarget

Properties

className

val className: ClassName

members

val members: List<CodeBlock>

useSiteTarget

val useSiteTarget: AnnotationSpec.UseSiteTarget?

Functions

equals

fun equals(other: Any?): Boolean

hashCode

fun hashCode(): Int

toBuilder

fun toBuilder(): AnnotationSpec.Builder

toString

fun toString(): String

Companion Object Functions

builder

fun builder(type: ClassName): AnnotationSpec.Builder
fun builder(type: Class<out Annotation>): AnnotationSpec.Builder
fun builder(type: KClass<out Annotation>): AnnotationSpec.Builder

get

fun get(annotation: Annotation, includeDefaultValues: Boolean = false): AnnotationSpec
fun get(annotation: AnnotationMirror): AnnotationSpec

Extension Functions

tag

fun <T : Any> Taggable.tag(): T?

Returns the tag attached with T as a key, or null if no tag is attached with that key.