mirror of
https://github.com/fankes/moshi.git
synced 2025-10-20 00:19:21 +08:00
Allow custom generators (#847)
* Extract generatedJsonAdapterName to public API for other generators/consumers * Fix kapt location in tests * Add IDE-generated dependency-reduced-pom.xml to gitignore This always bites me * Add generator property to JsonClass and skip in processor * Opportunistically fix formatting for generateAdapter doc * Extract NullSafeJsonAdapter for delegate testing * Add custom adapter tests * Allow no-moshi constructors for generated adapters * Fix rebase issue * Use something other than nullSafe() for lenient check This no longer propagates lenient * Add missing copyrights * Add top-level class note * Add note about working against Moshi's generated signature * Add missing bit to "requirements for" * Note kotlin requirement relaxed in custom generators * Style
This commit is contained in:
@@ -85,7 +85,7 @@ class JsonClassCodegenProcessor : KotlinAbstractProcessor(), KotlinMetadataUtils
|
||||
override fun process(annotations: Set<TypeElement>, roundEnv: RoundEnvironment): Boolean {
|
||||
for (type in roundEnv.getElementsAnnotatedWith(annotation)) {
|
||||
val jsonClass = type.getAnnotation(annotation)
|
||||
if (jsonClass.generateAdapter) {
|
||||
if (jsonClass.generateAdapter && jsonClass.generator.isEmpty()) {
|
||||
val generator = adapterGenerator(type) ?: continue
|
||||
generator.generateFile(generatedType)
|
||||
.writeTo(filer)
|
||||
|
Reference in New Issue
Block a user