https://kotlinlang.org logo
#announcements
Title
# announcements
t

Toddobryan

06/17/2019, 3:30 PM
I'm trying my hand at writing an annotation processor and, ideally, would like access to the parameters and default values in a class's constructor. However, I'm not sure this is possible, since annotation processors use Java models for the elements they're operating on and Java doesn't have a concept of default values. Is this possible? Are there Kotlin models that annotation processors can use that know more than the Java ones?
t

tddmonkey

06/17/2019, 3:32 PM
#kapt
g

gildor

06/17/2019, 3:42 PM
You can use Kotlin metadata (there is official library for this), but as I know there is no way to get default value, because it's actually code that running on runtime (default value is not always static)
2 Views