Is there any documentation about writing kotlin an...
# announcements
j
Is there any documentation about writing kotlin annotation processors? I'm thinking about writing an annotation processors that would let you annotate a
data
class with
@Builder
and the data class would have a companion object with a method
builder()
get added that would then let you use the builder pattern to construct your
data
class. Not really that useful in kotlin but it would be really nice when you have a data class and you are creating it in java.
o
@yan
y
@jlleitschuh Annotation Processing API does not allow to modify existing classes so you can’t add a
companion object
to the class.
j
What does annotation processing allow you to do? Is there documentation regarding what things it can enable you to do?
y
Well, see any documentation for JSR 269, it should be described there.
j
Why can't the annotation processor modify existing classes. Isn't that exactly what lombok does?
Ah, it does something different. Sorry.