* Don't re-wrap nullsafe/nonnull adapters if they are already one
nullSafe() is often called defensively, which can lead to a lot of layers of wrapping and checking. This avoids that overhead where possible.
* Add tests
* Decouple AdapterGenerator from kotlin-metadata
* Decouple AdapterGenerator from javax elements API
* Extract checkIsVisibility helper
* Remove elements and kotlinmetadata from property, constructor, type
* Extract kotlinpoet-only parts to new API package for better separation
* Add mirroring APIs
* Finish extraction of PropertyGenerator to no-elements/no-kotlin-metadata
* Update for new tag API in KotlinPoet
* Update for new tag API in KotlinPoet
* Move rest of elements utils out of API
We should split this up better as metadata.kt has become a dumping ground
* Move type handling to JsonClassCodegenProcessor
* Rebase fix
* Opportunistic idiomatic require()
* Add Util#invokeDefaultConstructor
* Add defaultPrimitiveValue
This will be used to initialize required properties for later invocation of the default constructor
* Move isTransient into PropertyGenerator
We will need this in order to know how to invoke constructors even if they have transient parameters
* Add notion of hasLocalIsPresentName to PropertyGenerator
* Switch to using invokeDefaultConstructor for any default property types
* Add code gen versions of default constructor test
* Fix mismatched names
* Use Arrays.copyOf
* Unwrap InvocationTargetException
* Use name allocator
* Rename createMask to createDefaultValuesParametersMask, use it directly
* Opportunistically clean up result variable holder
Only needs to be made if we have non-parameter instances, otherwise we can just return directly
* Fix mask name
* Remove unnecessary mod
* Switch to local lazily-initialized constructor reference
Not working because of some issue in kotlinpoet I don't understand
* Fix named usage
* Clean up debugging dots
* Add proguard/R8 rule for keeping defaults constructor in targets
* Make constructor lookup property private
* Add another defensive dot
* Rework invokeDefaultConstructor to accept vararg args
A little more idiomatic
* Update proguard rules
* Use isNotEmpty()
* Use Metadata import directly
* Tighten visibility of IndexedParameterMap
* Use idiomatic require() checks
Didn't use it on a couple other places where readability would suffer
* Remove unnecessary type arg
* Remove unnecessary curly braces
* Use mutable list rather than allocate new lists
IntelliJ thinks this is a better approach
* Tighten KotlinJsonAdapter property visibility
* Suppress existing extraneous warnings
* Start MoshiKotlinExtensions
* Add Moshi.Builder.add() with reified typeOf
* Use non-shadowing name for addAdapter
* Implement KType.toType()
.javaType isn't implemented
* Don't re-wrap wrapped adapters
* Use new adapter functions in tests to smoke test
* Don't enable uses experimental in kotlin-reflect, only the test
* Use internal leniency API
* Use toType in addAdapter too
* Update error message in test
* removed limitation where subtypes should be unique
There can be use cases where different type labels should match with the same subtype
* added test for PolymorphicJsonAdapter non unique subtypes
* 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
* Support gradle incremental processing in code gen
This adds support for incremental compilation in gradle via incap helper and marking the code gen as `ISOLATING`.
Depends on a newer version of KotlinPoet that has https://github.com/square/kotlinpoet/pull/647Resolves#589
* Opportunistically update to auto-service 1.0-rc5
Supports incremental compilation and moves annotations to a separate artifact
* 1.2.0 final!
* Mark compiler embeddales as test only
Before, the KotlinJsonAdapter threw "java.lang.IndexOutOfBoundsException: Index: 0, Size: 0" on a duplicate key when the key matched a property that was not a constructor parameter.
* Add section about null safety
Null safety is an important feature of the Kotlin language.
The fact that Moshi supports wrapping existing adapters in a null safe or non-null variant is important for null safety.
Therefore it makes sense to promote this feature in the readme, as this is one of the first places people should look for support and such features.
* Move factory method section out of Kotlin section
* Fix syntax highlighting
* Remove isLenient() reference
* Rewrite Kotlin example as Java, reformat comments