Created
February 20, 2021 05:59
-
-
Save SeongUgJung/acfd12ea849935563fff50f2b6b334bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun visitClassDeclaration(classDeclaration: KSClassDeclaration, data: Unit) { | |
classDeclaration.annotations.firstOrNull { annotation -> | |
// filter only JsonClass | |
annotation.shortName.asString() == "JsonClass" | |
}?.arguments?.firstOrNull { argument -> | |
// check @JsonClass(generateAdapter = true) | |
argument.name?.asString() == "generateAdapter" && argument.value == true | |
} | |
?.let { | |
// collect class to use in SymbolProcessor.finish() | |
targets.add(classDeclaration) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment