diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 965d31c..b221a97 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -15,7 +15,6 @@
-
diff --git a/README.md b/README.md
index c9bbca6..4f1a464 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,11 @@
fluid-json
==========
-[![Kotlin](https://img.shields.io/badge/Kotlin-1.3.50-blue.svg)](http://kotlinlang.org)
-[![Bintray](https://img.shields.io/bintray/v/fluidsonic/maven/fluid-json)](https://bintray.com/fluidsonic/maven/fluid-json)
+[![Maven Central](https://img.shields.io/maven-central/v/io.fluidsonic.json/fluid-json?label=Maven%20Central)](https://search.maven.org/artifact/io.fluidsonic.json/fluid-json)
+[![JCenter](https://img.shields.io/bintray/v/fluidsonic/kotlin/json?label=JCenter)](https://bintray.com/fluidsonic/kotlin/json)
+[![Kotlin](https://img.shields.io/badge/Kotlin-1.3.50-blue.svg)](https://github.com/JetBrains/kotlin/releases/v1.3.50)
[![Build Status](https://travis-ci.org/fluidsonic/fluid-json.svg?branch=master)](https://travis-ci.org/fluidsonic/fluid-json)
[![#fluid-libraries Slack Channel](https://img.shields.io/badge/slack-%23fluid--libraries-543951.svg)](https://kotlinlang.slack.com/messages/C7UDFSVT2/)
-[![Awesome Kotlin](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin)
A JSON library written in pure Kotlin.
@@ -32,21 +32,15 @@ Table of Contents
Installation
------------
-All artifacts are [available on Bintray](https://bintray.com/fluidsonic/maven/fluid-json) as `fluid-json-…` in the group `com.github.fluidsonic`.
-
`build.gradle.kts`:
```kotlin
plugins {
kotlin("kapt")
}
-repositories {
- maven("https://dl.bintray.com/fluidsonic/maven/")
-}
-
dependencies {
- kapt("com.github.fluidsonic:fluid-json-annotation-processor:0.9.25")
- implementation("com.github.fluidsonic:fluid-json-coding-jdk8:0.9.25")
+ kapt("io.fluidsonic.json:fluid-json-annotation-processor:1.0.0")
+ implementation("io.fluidsonic.json:fluid-json-coding-jdk8:1.0.0")
}
```
@@ -61,15 +55,15 @@ _Preferences > Build, Execution, Deployment > Build Tools > Gradle > Runner > De
Basic Usage
-----------
-`fluid-json` uses `@JSON`-annotations for automatically generating codec classes at compile-time which are responsible for decoding and encoding from and to
+`fluid-json` uses `@Json`-annotations for automatically generating codec classes at compile-time which are responsible for decoding and encoding from and to
JSON.
You can also [create these codecs on your own](#manual-coding) instead of relying on annotation processing.
```kotlin
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
data class Event(
val attendees: Collection,
val description: String,
@@ -79,7 +73,7 @@ data class Event(
val title: String
)
-@JSON
+@Json
data class Attendee(
val emailAddress: String,
val firstName: String,
@@ -96,7 +90,7 @@ enum class RSVP {
Then create a parser and a serializer which make use of the generated codecs:
```kotlin
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
fun main() {
val data = Event(
@@ -111,15 +105,15 @@ fun main() {
title = "fluid-json MeetUp"
)
- val serializer = JSONCodingSerializer.builder()
- .encodingWith(EventJSONCodec, AttendeeJSONCodec)
+ val serializer = JsonCodingSerializer.builder()
+ .encodingWith(EventJsonCodec, AttendeeJsonCodec)
.build()
val serialized = serializer.serializeValue(data)
println("serialized: $serialized")
- val parser = JSONCodingParser.builder()
- .decodingWith(EventJSONCodec, AttendeeJSONCodec)
+ val parser = JsonCodingParser.builder()
+ .decodingWith(EventJsonCodec, AttendeeJsonCodec)
.build()
val parsed = parser.parseValueOfType(serialized)
@@ -143,7 +137,7 @@ Annotation Customization
In this section are a few examples on how JSON codec generation can be customized.
The full documentation on all annotations and properties controlling the JSON codec generation can be found in the
-[KDoc for `@JSON`](https://github.com/fluidsonic/fluid-json/blob/master/annotations/sources/JSON.kt).
+[KDoc for `@Json`](https://github.com/fluidsonic/fluid-json/blob/master/annotations/sources/Json.kt).
### Collect all generated codecs in one codec provider
@@ -151,12 +145,12 @@ All codecs in your module generated by annotation processing can automatically b
It also frees
```kotlin
-@JSON.CodecProvider
-interface MyCodecProvider: JSONCodecProvider
+@Json.CodecProvider
+interface MyCodecProvider: JsonCodecProvider
fun main() {
- val parser = JSONCodingParser.builder()
- .decodingWith(JSONCodecProvider.generated(MyCodecProvider::class))
+ val parser = JsonCodingParser.builder()
+ .decodingWith(JsonCodecProvider.generated(MyCodecProvider::class))
.build()
// …
}
@@ -165,10 +159,10 @@ fun main() {
### Customize the generated codec
```kotlin
-@JSON(
- codecName = "MyCoordinateCodec", // customize the JSONCodec's name
- codecPackageName = "some.other.location", // customize the JSONCodec's package
- codecVisibility = JSON.CodecVisibility.publicRequired // customize the JSONCodec's visibility
+@Json(
+ codecName = "MyCoordinateCodec", // customize the JsonCodec's name
+ codecPackageName = "some.other.location", // customize the JsonCodec's package
+ codecVisibility = Json.CodecVisibility.publicRequired // customize the JsonCodec's visibility
)
data class GeoCoordinate2(
val latitude: Double,
@@ -179,8 +173,8 @@ data class GeoCoordinate2(
### Customize what constructor is used for decoding
```kotlin
-@JSON(
- decoding = JSON.Decoding.annotatedConstructor // require one constructor to be annotated explicitly
+@Json(
+ decoding = Json.Decoding.annotatedConstructor // require one constructor to be annotated explicitly
)
data class GeoCoordinate3(
val altitude: Double,
@@ -188,7 +182,7 @@ data class GeoCoordinate3(
val longitude: Double
) {
- @JSON.Constructor
+ @Json.Constructor
constructor(latitude: Double, longitude: Double) : this(
altitude = -1.0,
latitude = latitude,
@@ -203,12 +197,12 @@ data class GeoCoordinate3(
### Customize what properties are used for encoding (opt-in)
```kotlin
-@JSON(
- encoding = JSON.Encoding.annotatedProperties // only encode properties annotated explicitly
+@Json(
+ encoding = Json.Encoding.annotatedProperties // only encode properties annotated explicitly
)
data class User(
- @JSON.Property val id: String,
- @JSON.Property val name: String,
+ @Json.Property val id: String,
+ @Json.Property val name: String,
val passwordHash: String
)
@@ -219,11 +213,11 @@ data class User(
### Customize what properties are used for encoding (opt-out)
```kotlin
-@JSON
+@Json
data class User(
val id: String,
val name: String,
- @JSON.Excluded val passwordHash: String
+ @Json.Excluded val passwordHash: String
)
// input: {"id":1,"name":"Some User","passwordHash":"123456"}
@@ -233,13 +227,13 @@ data class User(
### Encode extension properties
```kotlin
-@JSON
+@Json
data class Person(
val firstName: String,
val lastName: String
)
-@JSON.Property
+@Json.Property
val Person.name get() = "$firstName $lastName"
// input: {"firstName":"Marc","lastName":"Knaup"}
@@ -251,10 +245,10 @@ val Person.name get() = "$firstName $lastName"
Some prefer it that way ¯\\\_(ツ)\_/¯.
```kotlin
-@JSON
+@Json
data class Person(
- @JSON.Property("first_name") val firstName: String,
- @JSON.Property("last_name") val lastName: String
+ @Json.Property("first_name") val firstName: String,
+ @Json.Property("last_name") val lastName: String
)
// input/input: {"first_name":"John","last_name":"Doe"}
@@ -263,8 +257,8 @@ data class Person(
### Inline a single value
```kotlin
-@JSON(
- representation = JSON.Representation.singleValue // no need to wrap in a structured JSON object
+@Json(
+ representation = Json.Representation.singleValue // no need to wrap in a structured JSON object
)
class EmailAddress(val value: String)
@@ -275,9 +269,9 @@ class EmailAddress(val value: String)
### Prevent encoding completely
```kotlin
-@JSON(
- encoding = JSON.Encoding.none, // prevent encoding altogether
- representation = JSON.Representation.singleValue // no need to wrap in a structured JSON object
+@Json(
+ encoding = Json.Encoding.none, // prevent encoding altogether
+ representation = Json.Representation.singleValue // no need to wrap in a structured JSON object
)
class Password(val secret: String)
@@ -288,8 +282,8 @@ class Password(val secret: String)
### Prevent decoding completely
```kotlin
-@JSON(
- decoding = JSON.Decoding.none // prevent decoding altogether
+@Json(
+ decoding = Json.Decoding.none // prevent decoding altogether
)
class Response(val result: result)
@@ -300,37 +294,37 @@ class Response(val result: result)
### Add properties depending on the context
```kotlin
-@JSON(
- decoding = JSON.Decoding.none, // prevent decoding altogether
- encoding = JSON.Encoding.annotatedProperties // only encode properties annotated explicitly
+@Json(
+ decoding = Json.Decoding.none, // prevent decoding altogether
+ encoding = Json.Encoding.annotatedProperties // only encode properties annotated explicitly
)
data class User(
- @JSON.Property val id: String,
- @JSON.Property val name: String,
+ @Json.Property val id: String,
+ @Json.Property val name: String,
val emailAddress: String
)
-@JSON.CustomProperties // function will be called during encoding
-fun JSONEncoder.writeCustomProperties(value: User) {
+@Json.CustomProperties // function will be called during encoding
+fun JsonEncoder.writeCustomProperties(value: User) {
if (context.authenticatedUserId == value.id)
writeMapElement("emailAddress", value = value.emailAddress)
}
-@JSON.CodecProvider
-interface MyCodecProvider: JSONCodecProvider
+@Json.CodecProvider
+interface MyCodecProvider: JsonCodecProvider
data class MyContext(
val authenticatedUserId: String?
-): JSONCodingContext
+): JsonCodingContext
fun main() {
- val serializer = JSONCodingSerializer
+ val serializer = JsonCodingSerializer
.builder(MyContext(authenticatedUserId = "5678"))
- .encodingWith(JSONCodecProvider.generated(MyCodecProvider::class))
+ .encodingWith(JsonCodecProvider.generated(MyCodecProvider::class))
.build()
println(serializer.serializeValue(listOf(
@@ -349,14 +343,14 @@ If a type is not part of your module you can still annotate it indirectly in ord
Note that this currently does not work correctly if the type has internal properties or an internal primary constructor.
```kotlin
-@JSON.CodecProvider(
+@Json.CodecProvider(
externalTypes = [
- JSON.ExternalType(Triple::class, JSON(
- codecVisibility = JSON.CodecVisibility.publicRequired
+ Json.ExternalType(Triple::class, Json(
+ codecVisibility = Json.CodecVisibility.publicRequired
))
]
)
-interface MyCodecProvider: JSONCodecProvider
+interface MyCodecProvider: JsonCodecProvider
```
@@ -379,7 +373,7 @@ classes from and to JSON.
### Simple Parsing
```kotlin
-… = JSONParser.default.parseValue("""{ "hello": "world", "test": 123 }""")
+… = JsonParser.default.parseValue("""{ "hello": "world", "test": 123 }""")
// returns a value like this:
mapOf(
@@ -396,7 +390,7 @@ You can also accept a `null` value by using `parseValueOrNull` instead.
### Simple Serializing
```kotlin
-JSONSerializer.default.serializeValue(mapOf(
+JsonSerializer.default.serializeValue(mapOf(
"hello" to "world",
"test" to 123
))
@@ -414,10 +408,10 @@ While the examples above parse and return JSON as `String` you can also use `Rea
```kotlin
val reader: Reader = …
-… = JSONParser.default.parseValue(source = reader)
+… = JsonParser.default.parseValue(source = reader)
val writer: Writer = …
-JSONSerializer.default.serializeValue(…, destination = writer)
+JsonSerializer.default.serializeValue(…, destination = writer)
```
Full example [for Reader](https://github.com/fluidsonic/fluid-json/blob/master/examples/sources/0011-ParsingFromReader.kt)
@@ -426,11 +420,11 @@ and [for Writer](https://github.com/fluidsonic/fluid-json/blob/master/examples/s
### Parsing Lists and Maps
-You can also parse lists and maps in a type-safe way directly. Should it not be possible to parse the input as the requested Kotlin type a `JSONException` is
+You can also parse lists and maps in a type-safe way directly. Should it not be possible to parse the input as the requested Kotlin type a `JsonException` is
thrown. Note that this requires the `-coding` library variant.
```kotlin
-val parser = JSONCodingParser.default
+val parser = JsonCodingParser.default
parser.parseValueOfType>(…) // returns List<*>
parser.parseValueOfType>(…) // returns List
@@ -447,11 +441,11 @@ and [for Maps](https://github.com/fluidsonic/fluid-json/blob/master/examples/sou
### Streaming Parser
-`JSONReader` provides an extensive API for reading JSON values from a `Reader`.
+`JsonReader` provides an extensive API for reading JSON values from a `Reader`.
```kotlin
val input = StringReader("""{ "data": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] }""")
-JSONReader.build(input).use { reader ->
+JsonReader.build(input).use { reader ->
reader.readFromMapByElementValue { key ->
println(key)
@@ -469,11 +463,11 @@ Full example
### Streaming Writer
-`JSONWriter` provides an extensive API for writing JSON values to a `Writer`.
+`JsonWriter` provides an extensive API for writing JSON values to a `Writer`.
```kotlin
val output = StringWriter()
-JSONWriter.build(output).use { writer ->
+JsonWriter.build(output).use { writer ->
writer.writeIntoMap {
writeMapElement("data") {
writeIntoList {
@@ -494,22 +488,22 @@ Full example
### Type Encoder Codecs
While many basic Kotlin types like `String`, `List`, `Map` and `Boolean` are serialized automatically to their respective JSON counterparts you can easily add
-support for other types. Just write a codec for the type you'd like to serialize by implementing `JSONEncoderCodec` and pass an instance to the builder of
-either `JSONCodingSerializer` (high-level API) or `JSONEncoder` (streaming API).
+support for other types. Just write a codec for the type you'd like to serialize by implementing `JsonEncoderCodec` and pass an instance to the builder of
+either `JsonCodingSerializer` (high-level API) or `JsonEncoder` (streaming API).
-Codecs in turn can write other encodable values and `JSONEncoder` will automatically look up the right codec and use it to serialize these values.
+Codecs in turn can write other encodable values and `JsonEncoder` will automatically look up the right codec and use it to serialize these values.
-If your codec encounters an inappropriate value which it cannot encode then it will throw a `JSONException` in order to stop the serialization process.
+If your codec encounters an inappropriate value which it cannot encode then it will throw a `JsonException` in order to stop the serialization process.
-Because `JSONEncoderCodec` is simply an interface you can use `AbstractJSONEncoderCodec` as base class for your codec which simplifies implementing that
+Because `JsonEncoderCodec` is simply an interface you can use `AbstractJsonEncoderCodec` as base class for your codec which simplifies implementing that
interface.
```kotlin
data class MyType(…)
-object MyTypeCodec : AbstractJSONEncoderCodec() {
+object MyTypeCodec : AbstractJsonEncoderCodec() {
- override fun JSONEncoder.encode(value: MyType) {
+ override fun JsonEncoder.encode(value: MyType) {
// write JSON for `value` directly using the encoder (the receiver)
}
}
@@ -521,28 +515,28 @@ object MyTypeCodec : AbstractJSONEncoderCodec() {
### Type Decoder Codecs
While all JSON types are parsed automatically using appropriate Kotlin couterparts like `String`, `List`, `Map` and `Boolean` you can easily add support for
-other types. Just write a codec for the type you'd like to parse by implementing `JSONDecoderCodec` and pass an instance to the builder of either
-`JSONCodingParser` (high-level API) or `JSONDecoder` (streaming API).
+other types. Just write a codec for the type you'd like to parse by implementing `JsonDecoderCodec` and pass an instance to the builder of either
+`JsonCodingParser` (high-level API) or `JsonDecoder` (streaming API).
-Codecs in turn can read other decodable values and `JSONDecoder` will automatically look up the right codec and use it to parse these values.
+Codecs in turn can read other decodable values and `JsonDecoder` will automatically look up the right codec and use it to parse these values.
-If your codec encounters inappropriate JSON data which it cannot decode then it will throw a `JSONException` in order to stop the parsing process.
+If your codec encounters inappropriate JSON data which it cannot decode then it will throw a `JsonException` in order to stop the parsing process.
-Because `JSONDecoderCodec` is simply an interface you can use `AbstractJSONDecoderCodec` as base class for your codec which simplifies implementing that
+Because `JsonDecoderCodec` is simply an interface you can use `AbstractJsonDecoderCodec` as base class for your codec which simplifies implementing that
interface.
```kotlin
data class MyType(…)
-object MyTypeCodec : AbstractJSONDecoderCodec() {
+object MyTypeCodec : AbstractJsonDecoderCodec() {
- override fun JSONDecoder.decode(valueType: JSONCodingType): MyType {
+ override fun JsonDecoder.decode(valueType: JsonCodingType): MyType {
// read JSON using and create an instance of `MyType` using decoder (the receiver)
}
}
```
-A `JSONDecoderCodec` can also decode generic types. The instance passed to `JSONCodingType` contains information about generic arguments expected by the call
+A `JsonDecoderCodec` can also decode generic types. The instance passed to `JsonCodingType` contains information about generic arguments expected by the call
which caused this codec to be invoked. For `List` for example a single generic argument of type `Something` would be reported which allows for
example the list codec to serialize the list value's directly as `Something` using the respective codec.
@@ -551,25 +545,25 @@ example the list codec to serialize the list value's directly as `Something` usi
### Type Codecs
-If you want to be able to encode and decode the same type you can implement the interface `JSONCodec` which in turn extends `JSONEncoderCodec` and
-`JSONDecoderCodec`. That way you can reuse the same codec class for both, encoding and decoding.
+If you want to be able to encode and decode the same type you can implement the interface `JsonCodec` which in turn extends `JsonEncoderCodec` and
+`JsonDecoderCodec`. That way you can reuse the same codec class for both, encoding and decoding.
-Because `JSONCodec` is simply an interface you can use `AbstractJSONCodec` as base class for your codec which simplifies implementing that interface.
+Because `JsonCodec` is simply an interface you can use `AbstractJsonCodec` as base class for your codec which simplifies implementing that interface.
[Full example](https://github.com/fluidsonic/fluid-json/blob/master/examples/sources/0032-TypeCodecs.kt)
### Coding and Streaming
-You can use encoding and decoding codecs not just for high-level encoding and decoding using `JSONCodingSerializer` and `JSONCodingParser` but also for
-streaming-based encoding and decoding using `JSONEncoder` and `JSONDecoder`.
+You can use encoding and decoding codecs not just for high-level encoding and decoding using `JsonCodingSerializer` and `JsonCodingParser` but also for
+streaming-based encoding and decoding using `JsonEncoder` and `JsonDecoder`.
[Full example](https://github.com/fluidsonic/fluid-json/blob/master/examples/sources/0033-CodingAsStream.kt)
### Thread Safety
-All implementations of `JSONParser`, `JSONSerializer`, `JSONCodecProvider` as well as all codecs provided by this library are thread-safe and can be used from
+All implementations of `JsonParser`, `JsonSerializer`, `JsonCodecProvider` as well as all codecs provided by this library are thread-safe and can be used from
multiple threads without synchronization. It's strongly advised, though not required, that custom implementations are also thread-safe by default.
All other classes and interfaces are not thread-safe and must be used with approriate synchronization in place. It's recommended however to simply use a
@@ -581,19 +575,19 @@ Error Handling
--------------
Errors occuring during I/O operations in the underlying `Reader` or `Writer` cause an `IOException`.
-Errors occuring due to unsupported or mismatching types, malformed JSON or misused API cause a subclass of `JSONException` being thrown.
+Errors occuring due to unsupported or mismatching types, malformed JSON or misused API cause a subclass of `JsonException` being thrown.
Since in Kotlin every method can throw any kind of exception it's recommended to simply catch `Exception` when encoding or decoding JSON - unless handling
errors explicitly is not needed in your use-case. This is especially important if you parse JSON data from an unsafe source like a public API.
-### Default `JSONException` subclasses
+### Default `JsonException` subclasses
| Exception | Usage
| ----------------------------- | -----
-| `JSONException.Parsing` | Thrown when a `JSONReader` was used improperly, i.e. it's a development error.
-| `JSONException.Serialization` | Thrown when a `JSONWriter` is used inproperly, e.g. if it would result in malformed JSON.
-| `JSONException.Schema` | Thrown when a `JSONReader` or `JSONDecoder` reads data in an unexpected format, i.e. them schema of the JSON data is wrong.
-| `JSONException.Syntax` | Thrown when a `JSONReader` reads data which is not properly formatted JSON.
+| `JsonException.Parsing` | Thrown when a `JsonReader` was used improperly, i.e. it's a development error.
+| `JsonException.Serialization` | Thrown when a `JsonWriter` was used improperly, e.g. if it would result in malformed JSON.
+| `JsonException.Schema` | Thrown when a `JsonReader` or `JsonDecoder` reads data in an unexpected format, i.e. them schema of the JSON data is wrong.
+| `JsonException.Syntax` | Thrown when a `JsonReader` reads data which is not properly formatted JSON.
@@ -605,7 +599,7 @@ You can use this library with [`JsonFeature`](https://ktor.io/clients/http-clien
`build.gradle.kts`:
```kotlin
dependencies {
- implementation("com.github.fluidsonic:fluid-json-ktor-client:0.9.25")
+ implementation("io.fluidsonic.json:fluid-json-ktor-client:1.0.0")
}
```
@@ -614,11 +608,11 @@ Setting up your `HttpClient`:
val client = HttpClient(…) {
install(JsonFeature) {
serializer = FluidJsonSerializer(
- parser = JSONCodingParser
+ parser = JsonCodingParser
.builder()
.decodingWith(…)
.build(),
- serializer = JSONCodingSerializer
+ serializer = JsonCodingSerializer
.builder()
.encodingWith(…)
.build()
@@ -634,12 +628,12 @@ Modules
| Module | Usage
| --------------------------------- | -----
-| `fluid-json-annotation-processor` | `@JSON`-based `JSONCodec` creation using `kapt`
-| `fluid-json-annotations` | contains `@JSON` annotations
-| `fluid-json-basic` | low-level API with `JSONReader`/`JSONParser` and `JSONWriter`/`JSONSerializer`
-| `fluid-json-coding` | `JSONCodec`-based parsing and serialization using `JSONDecoder`/`JSONCodingParser` and `JSONEncoder`/`JSONCodingSerializer`
-| `fluid-json-coding-jdk8` | additional `JSONCodec`s for commonly used Java 8 types on top of `fluid-json-coding`
-| `fluid-json-ktor-client` | plugs in `JSONCodingParser`/`JSONCodingSerializer` to `ktor-client` using its `JsonSerializer`
+| `fluid-json-annotation-processor` | `@Json`-based `JsonCodec` creation using `kapt`
+| `fluid-json-annotations` | contains `@Json` annotations
+| `fluid-json-basic` | low-level API with `JsonReader`/`JsonParser` and `JsonWriter`/`JsonSerializer`
+| `fluid-json-coding` | `JsonCodec`-based parsing and serialization using `JsonDecoder`/`JsonCodingParser` and `JsonEncoder`/`JsonCodingSerializer`
+| `fluid-json-coding-jdk8` | additional `JsonCodec`s for commonly used Java 8 types on top of `fluid-json-coding`
+| `fluid-json-ktor-client` | plugs in `JsonCodingParser`/`JsonCodingSerializer` to `ktor-client` using its `JsonSerializer`
@@ -666,7 +660,7 @@ Type Mapping
#### Encoding
-The default implementations of `JSONWriter` and `JSONSerializer` encode Kotlin types as follows:
+The default implementations of `JsonWriter` and `JsonSerializer` encode Kotlin types as follows:
| Kotlin | JSON | Remarks
| --------------- | ------------------ | -------
@@ -699,7 +693,7 @@ The default implementations of `JSONWriter` and `JSONSerializer` encode Kotlin t
#### Decoding
-The default implementations of `JSONReader` and `JSONParser` decode JSON types as follows:
+The default implementations of `JsonReader` and `JsonParser` decode JSON types as follows:
| JSON | Kotlin | Remarks
| ------------------ | ---------------- | -------
@@ -746,72 +740,72 @@ For types in the `java.time` package the `-coding-jdk8` library variant must be
Architecture
------------
-- `JSONReader`/`JSONWriter` are at the lowest level and read/write JSON as a stream of `JSONToken`s:
+- `JsonReader`/`JsonWriter` are at the lowest level and read/write JSON as a stream of `JsonToken`s:
- part of `-basic` library variant
- character-level input/output
- validation of read/written syntax
- one instance per parsing/serializing (maintains state & holds reference to `Reader`/`Writer`)
-- `JSONParser`/`JSONSerializer` are built on top of `JSONReader`/`JSONWriter` and read/write a complete JSON value at once.
+- `JsonParser`/`JsonSerializer` are built on top of `JsonReader`/`JsonWriter` and read/write a complete JSON value at once.
- part of `-basic` library variant
- - completely hides usage of underlying `JSONReader`/`JSONWriter`
+ - completely hides usage of underlying `JsonReader`/`JsonWriter`
- encoding is performed using the actual type of values to be encoded
- - decoding is performed using the type expected by the caller of `JSONParser`'s `parse…` methods and only available for basic types
- - instance can be reused and creates one `JSONReader`/`JSONWriter` per parsing/serialization invocation
+ - decoding is performed using the type expected by the caller of `JsonParser`'s `parse…` methods and only available for basic types
+ - instance can be reused and creates one `JsonReader`/`JsonWriter` per parsing/serialization invocation
- ease of use is important
-- `JSONDecoder`/`JSONEncoder` are built on top of `JSONReader`/`JSONWriter` and decode/encode arbitrary Kotlin types from/to a stream of `JSONToken`s:
+- `JsonDecoder`/`JsonEncoder` are built on top of `JsonReader`/`JsonWriter` and decode/encode arbitrary Kotlin types from/to a stream of `JsonToken`s:
- part of `-coding` library variant
- - most read/write operations are forwarded to the underlying `JSONReader`/`JSONWriter`
- - some read/write operations are intercepted by `JSONEncoder` to encode compatible types using codecs
- - implementations provided by `JSONDecoderCodec`s and `JSONEncoderCodec`s
+ - most read/write operations are forwarded to the underlying `JsonReader`/`JsonWriter`
+ - some read/write operations are intercepted by `JsonEncoder` to encode compatible types using codecs
+ - implementations provided by `JsonDecoderCodec`s and `JsonEncoderCodec`s
- inspired by MongoDB's [Codec and CodecRegistry](http://mongodb.github.io/mongo-java-driver/3.9/bson/codecs/)
- - one instance per parsing/serialization invocation (holds reference to `JSONReader`/`JSONWriter`)
-- `JSONCodingParser`/`JSONCodingSerializer` are built on top of `JSONDecoder`/`JSONEncoder` and read/write a complete JSON value at once.
+ - one instance per parsing/serialization invocation (holds reference to `JsonReader`/`JsonWriter`)
+- `JsonCodingParser`/`JsonCodingSerializer` are built on top of `JsonDecoder`/`JsonEncoder` and read/write a complete JSON value at once.
- part of `-coding` library variant
- - completely hides usage of underlying `JSONDecoder`/`JSONEncoder`
- - encoding is performed using the actual type of values to be encoded using a matching `JSONEncoderCodec` implementation
- - decoding is performed using the type expected by the caller of `JSONParser`'s `parse…` methods and a matching `JSONDecoderCodec` implementation
- - instance can be reused and creates one `JSONDecoder`/`JSONEncoder` per parsing/serialization invocation
+ - completely hides usage of underlying `JsonDecoder`/`JsonEncoder`
+ - encoding is performed using the actual type of values to be encoded using a matching `JsonEncoderCodec` implementation
+ - decoding is performed using the type expected by the caller of `JsonParser`'s `parse…` methods and a matching `JsonDecoderCodec` implementation
+ - instance can be reused and creates one `JsonDecoder`/`JsonEncoder` per parsing/serialization invocation
- ease of use is important
Most public API is provided as `interface`s in order to allow for plugging in custom behavior and to allow easy unit testing of code which produces or consumes
JSON.
-The default implementations of `JSONDecoder`/`JSONEncoder` use a set of pre-defined codecs in order to support decoding/encoding various basic Kotlin types like
+The default implementations of `JsonDecoder`/`JsonEncoder` use a set of pre-defined codecs in order to support decoding/encoding various basic Kotlin types like
`String`, `List`, `Map`, `Boolean` and so on. Codecs for classes which are available only since Java 8 are provided by the `-coding-jdk8` library variant.
### Recursive vs. Non-Recursive
While codec-based decoding/encoding has to be implemented recursively in order to be efficient and easy to use it's sometimes not desirable to parse/serialize
-JSON recursively. For that reason the default container codecs like `MapJSONCodec` also provide a `nonRecursive` codec. Since they read/write a whole value at
-once using `JSONReader`'s/`JSONWriter`'s primitive `read*`/`write*` methods they will not use any other codecs and thus don't support encoding or decoding other
+JSON recursively. For that reason the default container codecs like `MapJsonCodec` also provide a `nonRecursive` codec. Since they read/write a whole value at
+once using `JsonReader`'s/`JsonWriter`'s primitive `read*`/`write*` methods they will not use any other codecs and thus don't support encoding or decoding other
non-basic types.
-`JSONCodingParser.nonRecursive` and `JSONCodingSerializer.nonRecursive` both operate on these codecs and are thus a non-recursive parser/serializer.
+`JsonCodingParser.nonRecursive` and `JsonCodingSerializer.nonRecursive` both operate on these codecs and are thus a non-recursive parser/serializer.
### Classes and Interfaces
| Type | Description
| -------------------------- | -----------
-| `AbstractJSONCodec` | Abstract base class which simplifies implementing `JSONCodec`.
-| `AbstractJSONDecoderCodec` | Abstract base class which simplifies implementing `JSONDecoderCodec`.
-| `AbstractJSONEncoderCodec` | Abstract base class which simplifies implementing `JSONEncoderCodec`.
-| `DefaultJSONCodecs` | Contains lists of default codecs which can be used when contructing custom `JSONCodecProvider`s.
-| `JSONCodec` | Interface for classes which implement both, `JSONEncoderCodec` and `JSONDecoderCodec`. Also simplifies creating such codecs.
-| `JSONCodecProvider` | Interface for classes which when given a `JSONCodingType` (for decoding) or `KClass` (for encoding) return a codec which is able to decode/encode values of that type.
-| `JSONCodingContext` | Interface for context types. Instances of context types can be passed to `JSONParser`, `JSONSerializer`, `JSONDecoder` and `JSONEncoder`. They in turn can be used by custom codecs to help decoding/encoding values if needed.
-| `JSONCodingParser` | Interface for high-level reusable JSON parsers with codec providers and context already configured.
-| `JSONCodingSerializer` | Interface for high-level reusable JSON serializers where codec providers and context are already configured.
-| `JSONCodingType` | Roughly describes a Kotlin type which can be decoded from JSON. It includes relevant generic information which allows decoding for example `List` instead of just `List<*>`. Also known as [type token](http://gafter.blogspot.de/2006/12/super-type-tokens.html)).
-| `JSONDecoder` | Interface which extends `JSONReader` to enable reading values of any Kotlin type from JSON using `JSONCodecProvider`s for type mapping.
-| `JSONDecoderCodec` | Interface for decoding a value of a specific Kotlin type using a `JSONDecoder`.
-| `JSONEncoder` | Interface which extends `JSONWriter` to enable writing values of any Kotlin type as JSON using `JSONCodecProvider`s for type mapping.
-| `JSONEncoderCodec` | Interface for encoding a value of a specific Kotlin type using a `JSONEncoder`.
-| `JSONException` | Exception base class which is thrown whenever JSON cannot be written or read for non-IO reasons (e.g. malformed JSON, wrong state in reader/writer, missing type mapping).
-| `JSONParser` | Interface for high-level reusable JSON parsers which support only basic types.
-| `JSONReader` | Interface for low-level JSON parsing on a token-by-token basis.
-| `JSONSerializer` | Interface for high-level reusable JSON serializers which support only basic types.
-| `JSONToken` | Enum containing all types of tokens a `JSONReader` can read.
-| `JSONWriter` | Interface for low-level JSON serialization on a token-by-token basis.
+| `AbstractJsonCodec` | Abstract base class which simplifies implementing `JsonCodec`.
+| `AbstractJsonDecoderCodec` | Abstract base class which simplifies implementing `JsonDecoderCodec`.
+| `AbstractJsonEncoderCodec` | Abstract base class which simplifies implementing `JsonEncoderCodec`.
+| `DefaultJsonCodecs` | Contains lists of default codecs which can be used when contructing custom `JsonCodecProvider`s.
+| `JsonCodec` | Interface for classes which implement both, `JsonEncoderCodec` and `JsonDecoderCodec`. Also simplifies creating such codecs.
+| `JsonCodecProvider` | Interface for classes which when given a `JsonCodingType` (for decoding) or `KClass` (for encoding) return a codec which is able to decode/encode values of that type.
+| `JsonCodingContext` | Interface for context types. Instances of context types can be passed to `JsonParser`, `JsonSerializer`, `JsonDecoder` and `JsonEncoder`. They in turn can be used by custom codecs to help decoding/encoding values if needed.
+| `JsonCodingParser` | Interface for high-level reusable JSON parsers with codec providers and context already configured.
+| `JsonCodingSerializer` | Interface for high-level reusable JSON serializers where codec providers and context are already configured.
+| `JsonCodingType` | Roughly describes a Kotlin type which can be decoded from JSON. It includes relevant generic information which allows decoding for example `List` instead of just `List<*>`. Also known as [type token](http://gafter.blogspot.de/2006/12/super-type-tokens.html)).
+| `JsonDecoder` | Interface which extends `JsonReader` to enable reading values of any Kotlin type from JSON using `JsonCodecProvider`s for type mapping.
+| `JsonDecoderCodec` | Interface for decoding a value of a specific Kotlin type using a `JsonDecoder`.
+| `JsonEncoder` | Interface which extends `JsonWriter` to enable writing values of any Kotlin type as JSON using `JsonCodecProvider`s for type mapping.
+| `JsonEncoderCodec` | Interface for encoding a value of a specific Kotlin type using a `JsonEncoder`.
+| `JsonException` | Exception base class which is thrown whenever JSON cannot be written or read for non-IO reasons (e.g. malformed JSON, wrong state in reader/writer, missing type mapping).
+| `JsonParser` | Interface for high-level reusable JSON parsers which support only basic types.
+| `JsonReader` | Interface for low-level JSON parsing on a token-by-token basis.
+| `JsonSerializer` | Interface for high-level reusable JSON serializers which support only basic types.
+| `JsonToken` | Enum containing all types of tokens a `JsonReader` can read.
+| `JsonWriter` | Interface for low-level JSON serialization on a token-by-token basis.
| `*Codec` | The various codec classes are concrete codecs for common Kotlin types.
@@ -832,3 +826,8 @@ License
-------
Apache 2.0
+
+
+--------------------------
+
+[![Awesome Kotlin](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin)
diff --git a/annotation-processor/build.gradle.kts b/annotation-processor/build.gradle.kts
index 3ceb842..a9c7c24 100644
--- a/annotation-processor/build.gradle.kts
+++ b/annotation-processor/build.gradle.kts
@@ -1,13 +1,12 @@
-import com.github.fluidsonic.fluid.library.*
+import io.fluidsonic.gradle.*
import org.jetbrains.kotlin.gradle.plugin.*
plugins {
kotlin("kapt")
}
-fluidJvmLibraryVariant {
+fluidJvmLibraryVariant(JvmTarget.jdk8) {
description = "A JSON library written in pure Kotlin (annotation processor)"
- jdk = JvmTarget.jdk8
}
dependencies {
@@ -15,8 +14,8 @@ dependencies {
implementation(project(":fluid-json-coding"))
implementation(kotlin("reflect"))
- implementation(fluid("meta-jvm", "0.9.11"))
- implementation(fluid("stdlib", "0.9.25")) {
+ implementation(fluid("meta", "0.9.12"))
+ implementation(fluid("stdlib", "0.9.28")) {
attributes {
attribute(KotlinPlatformType.attribute, KotlinPlatformType.jvm)
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage::class.java, Usage.JAVA_RUNTIME))
@@ -25,20 +24,9 @@ dependencies {
}
implementation("com.google.auto:auto-common:0.10")
implementation("com.google.auto.service:auto-service:1.0-rc6")
- implementation("com.squareup:kotlinpoet:1.4.0")
+ implementation("com.squareup:kotlinpoet:1.4.1")
kapt("com.google.auto.service:auto-service:1.0-rc6")
- testImplementation(fluid("compiler", "0.9.6"))
+ testImplementation(fluid("compiler", "0.9.7"))
}
-
-configurations {
- all {
- // https://youtrack.jetbrains.com/issue/KT-31641
- // https://youtrack.jetbrains.com/issue/KT-33206
-
- if (name.contains("kapt"))
- attributes.attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage::class.java, Usage.JAVA_RUNTIME))
- }
-}
-
diff --git a/annotation-processor/sources/AnnotationProcessor.kt b/annotation-processor/sources/AnnotationProcessor.kt
index 953fef4..9eeb674 100644
--- a/annotation-processor/sources/AnnotationProcessor.kt
+++ b/annotation-processor/sources/AnnotationProcessor.kt
@@ -1,4 +1,4 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
import com.google.auto.service.*
import java.io.*
diff --git a/annotation-processor/sources/collection/CollectionPhase.kt b/annotation-processor/sources/collection/CollectionPhase.kt
index c366744..9289c7b 100644
--- a/annotation-processor/sources/collection/CollectionPhase.kt
+++ b/annotation-processor/sources/collection/CollectionPhase.kt
@@ -1,7 +1,7 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
-import com.github.fluidsonic.fluid.json.*
-import com.github.fluidsonic.fluid.meta.*
+import io.fluidsonic.json.*
+import io.fluidsonic.meta.*
import javax.annotation.processing.*
import javax.lang.model.element.*
import javax.lang.model.type.*
@@ -15,12 +15,12 @@ internal class CollectionPhase(
) {
val annotationClasses = setOf(
- JSON::class,
- JSON.CodecProvider::class,
- JSON.Constructor::class,
- JSON.CustomProperties::class,
- JSON.Excluded::class,
- JSON.Property::class
+ Json::class,
+ Json.CodecProvider::class,
+ Json.Constructor::class,
+ Json.CustomProperties::class,
+ Json.Excluded::class,
+ Json.Property::class
)
@@ -29,12 +29,12 @@ internal class CollectionPhase(
fun collect(roundEnvironment: RoundEnvironment) {
- collect(JSON::class, roundEnvironment = roundEnvironment, collector = this::collect)
- collect(JSON.CodecProvider::class, roundEnvironment = roundEnvironment, collector = this::collect)
- collect(JSON.Constructor::class, roundEnvironment = roundEnvironment, collector = this::collect)
- collect(JSON.CustomProperties::class, roundEnvironment = roundEnvironment, collector = this::collect)
- collect(JSON.Excluded::class, roundEnvironment = roundEnvironment, collector = this::collect)
- collect(JSON.Property::class, roundEnvironment = roundEnvironment, collector = this::collect)
+ collect(Json::class, roundEnvironment = roundEnvironment, collector = this::collect)
+ collect(Json.CodecProvider::class, roundEnvironment = roundEnvironment, collector = this::collect)
+ collect(Json.Constructor::class, roundEnvironment = roundEnvironment, collector = this::collect)
+ collect(Json.CustomProperties::class, roundEnvironment = roundEnvironment, collector = this::collect)
+ collect(Json.Excluded::class, roundEnvironment = roundEnvironment, collector = this::collect)
+ collect(Json.Property::class, roundEnvironment = roundEnvironment, collector = this::collect)
}
@@ -53,12 +53,12 @@ internal class CollectionPhase(
}
- private fun collect(annotation: JSON, roundEnvironment: RoundEnvironment, element: Element) =
+ private fun collect(annotation: Json, roundEnvironment: RoundEnvironment, element: Element) =
collect(annotation = annotation, roundEnvironment = roundEnvironment, element = element, preferredCodecPackageName = null)
@Suppress("UNUSED_PARAMETER")
- private fun collect(annotation: JSON, roundEnvironment: RoundEnvironment, element: Element, preferredCodecPackageName: MPackageName?) {
+ private fun collect(annotation: Json, roundEnvironment: RoundEnvironment, element: Element, preferredCodecPackageName: MPackageName?) {
val meta = Meta.of(element)
?: fail("must be a Kotlin type")
@@ -78,7 +78,7 @@ internal class CollectionPhase(
when (val visibility = meta.visibility) {
MVisibility.INTERNAL ->
- if (annotation.codecVisibility == JSON.CodecVisibility.publicRequired)
+ if (annotation.codecVisibility == Json.CodecVisibility.publicRequired)
fail("must be public if codec is supposed to be public")
MVisibility.PUBLIC ->
@@ -97,7 +97,7 @@ internal class CollectionPhase(
when (val visibility = enclosingType.visibility) {
MVisibility.INTERNAL -> {
- if (annotation.codecVisibility == JSON.CodecVisibility.publicRequired)
+ if (annotation.codecVisibility == Json.CodecVisibility.publicRequired)
fail("must only be nested in public types if codec is supposed to be public but '$enclosingElement' is $visibility")
actualVisibility = visibility
@@ -122,7 +122,7 @@ internal class CollectionPhase(
}
- private fun collect(annotation: JSON.CodecProvider, roundEnvironment: RoundEnvironment, element: Element) {
+ private fun collect(annotation: Json.CodecProvider, roundEnvironment: RoundEnvironment, element: Element) {
val interfaceMeta = Meta.of(element)
?: fail("must be a Kotlin type")
@@ -149,7 +149,7 @@ internal class CollectionPhase(
val supertype = (interfaceMeta.supertypes.singleOrNull() as? MTypeReference.Class)
?.takeIf { it.name == TypeNames.codecProviderType }
?: fail(
- "must only extend the interface JSONCodecProvider, extends " + interfaceMeta.supertypes
+ "must only extend the interface JsonCodecProvider, extends " + interfaceMeta.supertypes
.filterNot { it.name == TypeNames.anyType }
.joinToString { it.name?.toString() ?: "?" }
.ifEmpty { "none" }
@@ -167,7 +167,7 @@ internal class CollectionPhase(
)
@Suppress("UNCHECKED_CAST")
- element.getAnnotationMirror(MQualifiedTypeName.of(JSON.CodecProvider::class))
+ element.getAnnotationMirror(MQualifiedTypeName.of(Json.CodecProvider::class))
?.getValue>("externalTypes")
?.forEachIndexed { index, externalTypeAnnotationMirror ->
val externalTypeAnnotation = annotation.externalTypes[index]
@@ -176,13 +176,13 @@ internal class CollectionPhase(
?: error("cannot properly parse external type annotation mirror: $externalTypeAnnotationMirror")
if (externalType !is ReferenceType && externalTypeAnnotation.targetName.isEmpty())
- error("JSON.ExternalType can only be used for reference types, not for '$externalType' (if you are using an inline class you have to specify 'targetName' too)")
+ error("Json.ExternalType can only be used for reference types, not for '$externalType' (if you are using an inline class you have to specify 'targetName' too)")
val externalTypeName = externalTypeAnnotation.targetName.ifEmpty { externalType.toString() }
val externalTypeElement = typeResolver.resolveType(externalTypeName)
?: error("cannot find external type element for '$externalTypeName'")
- withFailureHandling(annotationClass = JSON.ExternalType::class, element = externalTypeElement) {
+ withFailureHandling(annotationClass = Json.ExternalType::class, element = externalTypeElement) {
collect(
annotation = externalTypeAnnotation.configuration,
roundEnvironment = roundEnvironment,
@@ -195,7 +195,7 @@ internal class CollectionPhase(
@Suppress("UNUSED_PARAMETER")
- private fun collect(annotation: JSON.Constructor, roundEnvironment: RoundEnvironment, element: Element) {
+ private fun collect(annotation: Json.Constructor, roundEnvironment: RoundEnvironment, element: Element) {
if (element !is ExecutableElement)
fail("cannot be used on that element")
@@ -228,7 +228,7 @@ internal class CollectionPhase(
@Suppress("UNUSED_PARAMETER")
- private fun collect(annotation: JSON.CustomProperties, roundEnvironment: RoundEnvironment, element: Element) {
+ private fun collect(annotation: Json.CustomProperties, roundEnvironment: RoundEnvironment, element: Element) {
if (element !is ExecutableElement)
fail("cannot be used on that element")
@@ -290,7 +290,7 @@ internal class CollectionPhase(
@Suppress("UNUSED_PARAMETER")
- private fun collect(annotation: JSON.Excluded, roundEnvironment: RoundEnvironment, element: Element) {
+ private fun collect(annotation: Json.Excluded, roundEnvironment: RoundEnvironment, element: Element) {
if (element !is ExecutableElement)
fail("cannot be used on that element")
@@ -309,8 +309,8 @@ internal class CollectionPhase(
val jvmMethodSignature = element.jvmMethodSignature
if (typeMeta is MConstructable && element.simpleName.contentEquals("")) {
- if (element.getAnnotation(JSON.Constructor::class.java) != null)
- fail("cannot be used along @JSON.Constructor on the same constructor")
+ if (element.getAnnotation(Json.Constructor::class.java) != null)
+ fail("cannot be used along @Json.Constructor on the same constructor")
val meta = typeMeta.constructors
.firstOrNull { it.jvmSignature.toString() == jvmMethodSignature }
@@ -324,8 +324,8 @@ internal class CollectionPhase(
)
}
else {
- if (element.getAnnotation(JSON.Property::class.java) != null)
- fail("cannot be used along @JSON.Property on the same property")
+ if (element.getAnnotation(Json.Property::class.java) != null)
+ fail("cannot be used along @Json.Property on the same property")
val meta = typeMeta.properties
.firstOrNull { it.jvmSyntheticMethodForAnnotationsSignature?.toString() == jvmMethodSignature }
@@ -347,7 +347,7 @@ internal class CollectionPhase(
}
- private fun collect(annotation: JSON.Property, roundEnvironment: RoundEnvironment, element: Element) {
+ private fun collect(annotation: Json.Property, roundEnvironment: RoundEnvironment, element: Element) {
when (element) {
is ExecutableElement -> collect(annotation = annotation, roundEnvironment = roundEnvironment, element = element)
is VariableElement -> collect(annotation = annotation, roundEnvironment = roundEnvironment, element = element)
@@ -357,7 +357,7 @@ internal class CollectionPhase(
@Suppress("UNUSED_PARAMETER")
- private fun collect(annotation: JSON.Property, roundEnvironment: RoundEnvironment, element: ExecutableElement) {
+ private fun collect(annotation: Json.Property, roundEnvironment: RoundEnvironment, element: ExecutableElement) {
val enclosingElement = element.enclosingElement
?: fail("cannot find enclosing element")
@@ -415,7 +415,7 @@ internal class CollectionPhase(
@Suppress("UNUSED_PARAMETER")
- private fun collect(annotation: JSON.Property, roundEnvironment: RoundEnvironment, element: VariableElement) {
+ private fun collect(annotation: Json.Property, roundEnvironment: RoundEnvironment, element: VariableElement) {
val functionElement = element.enclosingElement as? ExecutableElement
?: fail("cannot find enclosing function element")
@@ -470,19 +470,19 @@ internal class CollectionPhase(
private fun finishType(type: CollectedType): CollectionResult.Type {
val typeName = type.name
- val typeMeta = type.meta ?: fail("using @JSON.* annotations on members of type $typeName isn't allowed unless the type itself is annotated with @JSON")
+ val typeMeta = type.meta ?: fail("using @Json.* annotations on members of type $typeName isn't allowed unless the type itself is annotated with @Json")
return CollectionResult.Type(
actualVisibility = type.actualVisibility
- ?: fail("using @JSON.* annotations on members of type $typeName isn't allowed unless the type itself is annotated with @JSON"),
+ ?: fail("using @Json.* annotations on members of type $typeName isn't allowed unless the type itself is annotated with @Json"),
annotation = type.annotation
- ?: fail("using @JSON.* annotations on members of type $typeName isn't allowed unless the type itself is annotated with @JSON"),
+ ?: fail("using @Json.* annotations on members of type $typeName isn't allowed unless the type itself is annotated with @Json"),
constructor = type.constructors.ifEmpty { null }?.let { constructors ->
constructors.singleOrNull().also { singleConstructor ->
singleConstructor ?: fail(
- "annotating multiple constructors on type $typeName with @JSON.Constructor isn't allowed:\n" +
+ "annotating multiple constructors on type $typeName with @Json.Constructor isn't allowed:\n" +
constructors.joinToString(separator = "\n") { it.meta.toString() }
)
}
@@ -490,13 +490,13 @@ internal class CollectionPhase(
constructorExclusions = type.constructorExclusions.also { exclusions ->
if (exclusions.isNotEmpty() && type.constructors.isNotEmpty())
- fail("using @JSON.Excluded on constructors of type $typeName isn't allowed if explicitly selecting a constructor with @JSON.Constructor")
+ fail("using @Json.Excluded on constructors of type $typeName isn't allowed if explicitly selecting a constructor with @Json.Constructor")
},
customProperties = type.customProperties
.mapValues { (_, customProperties) ->
if (customProperties.size != 1) {
- fail("multiple @JSON.CustomProperties-annotated extension functions on type $typeName cannot have the same name:\n" +
+ fail("multiple @Json.CustomProperties-annotated extension functions on type $typeName cannot have the same name:\n" +
customProperties.joinToString(separator = "\n") { element ->
when (val extensionPackageName = element.extensionPackageName) {
null -> "// in $typeName\n${element.functionMeta}"
@@ -513,7 +513,7 @@ internal class CollectionPhase(
decodableProperties = type.decodableProperties,
element = type.element
- ?: fail("using @JSON.* annotations on members of type $typeName isn't allowed unless the type itself is annotated with @JSON"),
+ ?: fail("using @Json.* annotations on members of type $typeName isn't allowed unless the type itself is annotated with @Json"),
meta = typeMeta,
@@ -522,7 +522,7 @@ internal class CollectionPhase(
properties = type.properties
.mapValues { (_, properties) ->
if (properties.size != 1) {
- fail("multiple @JSON.Property-annotated properties of type $typeName cannot have the same name:\n" +
+ fail("multiple @Json.Property-annotated properties of type $typeName cannot have the same name:\n" +
properties.joinToString(separator = "\n") { element ->
when (val extensionPackageName = element.extensionPackageName) {
null -> "// in $typeName\n${element.meta}"
@@ -540,7 +540,7 @@ internal class CollectionPhase(
(it.visibility == MVisibility.PUBLIC || it.visibility == MVisibility.INTERNAL)
}
if (shadowingProperty != null)
- fail("@JSON.Property-annotated extension property is shadowed by a direct class member:\n" +
+ fail("@Json.Property-annotated extension property is shadowed by a direct class member:\n" +
"// in package ${property.extensionPackageName}\n${property.meta}\n" +
"// in $typeName\n$shadowingProperty")
}
@@ -571,7 +571,7 @@ internal class CollectionPhase(
) {
var actualVisibility: MVisibility? = null
- var annotation: JSON? = null
+ var annotation: Json? = null
val constructors: MutableCollection = mutableListOf()
val constructorExclusions: MutableMap = mutableMapOf()
val customProperties: MutableMap, MutableCollection> = mutableMapOf()
diff --git a/annotation-processor/sources/collection/CollectionResult.kt b/annotation-processor/sources/collection/CollectionResult.kt
index 83e7725..87ac41c 100644
--- a/annotation-processor/sources/collection/CollectionResult.kt
+++ b/annotation-processor/sources/collection/CollectionResult.kt
@@ -1,7 +1,7 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
-import com.github.fluidsonic.fluid.json.*
-import com.github.fluidsonic.fluid.meta.*
+import io.fluidsonic.json.*
+import io.fluidsonic.meta.*
import javax.lang.model.element.*
@@ -11,7 +11,7 @@ internal data class CollectionResult(
) {
data class CodecProvider(
- val annotation: JSON.CodecProvider,
+ val annotation: Json.CodecProvider,
val contextType: MTypeReference,
val element: TypeElement,
val interfaceMeta: MInterface,
@@ -21,21 +21,21 @@ internal data class CollectionResult(
data class Constructor(
- val annotation: JSON.Constructor,
+ val annotation: Json.Constructor,
val element: ExecutableElement,
val meta: MConstructor
)
data class ConstructorExclusion(
- val annotation: JSON.Excluded,
+ val annotation: Json.Excluded,
val meta: MConstructor,
val element: ExecutableElement
)
data class CustomProperties(
- val annotation: JSON.CustomProperties,
+ val annotation: Json.CustomProperties,
val element: ExecutableElement,
val extensionPackageName: MPackageName?,
val functionMeta: MFunction
@@ -43,14 +43,14 @@ internal data class CollectionResult(
data class DecodableProperty(
- val annotation: JSON.Property,
+ val annotation: Json.Property,
val element: VariableElement,
val meta: MValueParameter
)
data class Property(
- val annotation: JSON.Property,
+ val annotation: Json.Property,
val element: ExecutableElement,
val extensionPackageName: MPackageName?,
val meta: MProperty
@@ -58,7 +58,7 @@ internal data class CollectionResult(
data class PropertyExclusion(
- val annotation: JSON.Excluded,
+ val annotation: Json.Excluded,
val meta: MProperty,
val element: ExecutableElement
)
@@ -66,7 +66,7 @@ internal data class CollectionResult(
data class Type(
val actualVisibility: MVisibility,
- val annotation: JSON,
+ val annotation: Json,
val constructor: Constructor?,
val constructorExclusions: Map,
val customProperties: Collection,
diff --git a/annotation-processor/sources/generation/CodecGenerator.kt b/annotation-processor/sources/generation/CodecGenerator.kt
index 461094c..da9571c 100644
--- a/annotation-processor/sources/generation/CodecGenerator.kt
+++ b/annotation-processor/sources/generation/CodecGenerator.kt
@@ -1,10 +1,10 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
-import com.github.fluidsonic.fluid.json.*
-import com.github.fluidsonic.fluid.json.annotationprocessor.ProcessingResult.Codec.*
-import com.github.fluidsonic.fluid.meta.*
import com.squareup.kotlinpoet.*
import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy
+import io.fluidsonic.json.*
+import io.fluidsonic.json.annotationprocessor.ProcessingResult.Codec.*
+import io.fluidsonic.meta.*
import java.io.*
import kotlin.reflect.*
@@ -27,14 +27,14 @@ internal class CodecGenerator(
val decodableProperty = codec.decodingStrategy?.properties?.singleOrNull()
val encodableProperty = codec.encodingStrategy?.properties?.singleOrNull()
- val decoderType = JSONDecoder::class.asTypeName().parameterizedBy(codec.contextType.forKotlinPoet())
- val encoderType = JSONEncoder::class.asTypeName().parameterizedBy(codec.contextType.forKotlinPoet())
+ val decoderType = JsonDecoder::class.asTypeName().parameterizedBy(codec.contextType.forKotlinPoet())
+ val encoderType = JsonEncoder::class.asTypeName().parameterizedBy(codec.contextType.forKotlinPoet())
FileSpec.builder(codec.name.packageName.kotlin, typeName)
.indent("\t")
.apply {
if (decodableProperty != null) {
- addImport("com.github.fluidsonic.fluid.json",
+ addImport("io.fluidsonic.json",
"readBooleanOrNull",
"readByteOrNull",
"readCharOrNull",
@@ -49,7 +49,7 @@ internal class CodecGenerator(
)
}
if (encodableProperty != null) {
- addImport("com.github.fluidsonic.fluid.json",
+ addImport("io.fluidsonic.json",
"writeValueOrNull"
)
encodableProperty.importPackageName?.let { addImport(it.kotlin, encodableProperty.name.kotlin) }
@@ -59,9 +59,9 @@ internal class CodecGenerator(
.applyIf(!codec.isPublic) { addModifiers(KModifier.INTERNAL) }
.superclass(
when {
- decodableProperty == null -> AbstractJSONEncoderCodec::class
- encodableProperty == null -> AbstractJSONDecoderCodec::class
- else -> AbstractJSONCodec::class
+ decodableProperty == null -> AbstractJsonEncoderCodec::class
+ encodableProperty == null -> AbstractJsonDecoderCodec::class
+ else -> AbstractJsonCodec::class
}.asTypeName().parameterizedBy(codec.valueType, codec.contextType.forKotlinPoet())
)
.apply {
@@ -132,7 +132,7 @@ internal class CodecGenerator(
.indent("\t")
.apply {
if (codec.decodingStrategy != null) {
- addImport("com.github.fluidsonic.fluid.json",
+ addImport("io.fluidsonic.json",
"missingPropertyError",
"readBooleanOrNull",
"readByteOrNull",
@@ -151,11 +151,11 @@ internal class CodecGenerator(
val usesReflection = codec.decodingStrategy.properties.any { it.defaultValue == DecodableProperty.DefaultValue.defaultArgument }
if (usesReflection) {
addImport("kotlin.reflect", "KClass")
- addImport("com.github.fluidsonic.fluid.json", "jvmErasure")
+ addImport("io.fluidsonic.json", "jvmErasure")
}
}
if (codec.encodingStrategy != null) {
- addImport("com.github.fluidsonic.fluid.json",
+ addImport("io.fluidsonic.json",
"writeIntoMap",
"writeBooleanOrNull",
"writeByteOrNull",
@@ -187,9 +187,9 @@ internal class CodecGenerator(
.applyIf(!codec.isPublic) { addModifiers(KModifier.INTERNAL) }
.superclass(
when {
- codec.decodingStrategy == null -> AbstractJSONEncoderCodec::class
- codec.encodingStrategy == null -> AbstractJSONDecoderCodec::class
- else -> AbstractJSONCodec::class
+ codec.decodingStrategy == null -> AbstractJsonEncoderCodec::class
+ codec.encodingStrategy == null -> AbstractJsonDecoderCodec::class
+ else -> AbstractJsonCodec::class
}.asTypeName().parameterizedBy(codec.valueType, codec.contextType.forKotlinPoet())
)
.apply {
@@ -223,7 +223,7 @@ internal class CodecGenerator(
strategy: DecodingStrategy,
valueType: TypeName
): TypeSpec.Builder {
- val decoderType = JSONDecoder::class.asTypeName().parameterizedBy(codec.contextType.forKotlinPoet())
+ val decoderType = JsonDecoder::class.asTypeName().parameterizedBy(codec.contextType.forKotlinPoet())
val properties = strategy.properties.sortedBy { it.serializedName }
val rawValueType = (valueType as? ParameterizedTypeName)?.rawType ?: valueType
@@ -361,7 +361,7 @@ internal class CodecGenerator(
strategy: DecodingStrategy,
valueType: TypeName
): TypeSpec.Builder {
- val decoderType = JSONDecoder::class.asTypeName().parameterizedBy(codec.contextType.forKotlinPoet())
+ val decoderType = JsonDecoder::class.asTypeName().parameterizedBy(codec.contextType.forKotlinPoet())
val properties = strategy.properties.sortedBy { it.serializedName }
return addFunction(FunSpec.builder("decode")
@@ -475,7 +475,7 @@ internal class CodecGenerator(
strategy: EncodingStrategy,
valueType: TypeName
): TypeSpec.Builder {
- val encoderType = JSONEncoder::class.asTypeName().parameterizedBy(codec.contextType.forKotlinPoet())
+ val encoderType = JsonEncoder::class.asTypeName().parameterizedBy(codec.contextType.forKotlinPoet())
val customPropertyMethod = strategy.customPropertyMethods.sortedBy { it.second.kotlin }
val properties = strategy.properties.sortedBy { it.serializedName }
@@ -554,6 +554,6 @@ internal class CodecGenerator(
companion object {
- private val codingType = JSONCodingType::class.asTypeName()
+ private val codingType = JsonCodingType::class.asTypeName()
}
}
diff --git a/annotation-processor/sources/generation/CodecProviderGenerator.kt b/annotation-processor/sources/generation/CodecProviderGenerator.kt
index 2f3c497..c5c5052 100644
--- a/annotation-processor/sources/generation/CodecProviderGenerator.kt
+++ b/annotation-processor/sources/generation/CodecProviderGenerator.kt
@@ -1,9 +1,9 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
-import com.github.fluidsonic.fluid.json.*
-import com.github.fluidsonic.fluid.meta.*
import com.squareup.kotlinpoet.*
import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy
+import io.fluidsonic.json.*
+import io.fluidsonic.meta.*
import java.io.*
import kotlin.reflect.*
@@ -35,7 +35,7 @@ internal class CodecProviderGenerator(
.addSuperinterface(qualifiedTypeName)
.addSuperinterface(
codecProvider.interfaceType.forKotlinPoet(typeParameters = emptyList()),
- CodeBlock.of("JSONCodecProvider(${codecNames.sortedBy { it.kotlinInternal }.joinToString()})")
+ CodeBlock.of("JsonCodecProvider(${codecNames.sortedBy { it.kotlinInternal }.joinToString()})")
)
.build()
)
@@ -45,7 +45,7 @@ internal class CodecProviderGenerator(
.addMember("%S", "UNUSED_PARAMETER")
.build()
)
- .receiver(JSONCodecProvider.Companion::class)
+ .receiver(JsonCodecProvider.Companion::class)
.addParameter(name = "interfaceClass", type = KClass::class.asTypeName().parameterizedBy(qualifiedTypeName))
.returns(qualifiedTypeName)
.addCode("return %T\n", generatedQualifiedTypeName)
diff --git a/annotation-processor/sources/generation/GenerationPhase.kt b/annotation-processor/sources/generation/GenerationPhase.kt
index df2cae7..20e239a 100644
--- a/annotation-processor/sources/generation/GenerationPhase.kt
+++ b/annotation-processor/sources/generation/GenerationPhase.kt
@@ -1,4 +1,4 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
import java.io.*
diff --git a/annotation-processor/sources/processing/ProcessingPhase.kt b/annotation-processor/sources/processing/ProcessingPhase.kt
index d8cd829..95c17de 100644
--- a/annotation-processor/sources/processing/ProcessingPhase.kt
+++ b/annotation-processor/sources/processing/ProcessingPhase.kt
@@ -1,10 +1,10 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
-import com.github.fluidsonic.fluid.json.*
-import com.github.fluidsonic.fluid.json.annotationprocessor.ProcessingResult.Codec.*
-import com.github.fluidsonic.fluid.meta.*
import com.squareup.kotlinpoet.*
import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy
+import io.fluidsonic.json.*
+import io.fluidsonic.json.annotationprocessor.ProcessingResult.Codec.*
+import io.fluidsonic.meta.*
import javax.lang.model.element.*
@@ -83,16 +83,16 @@ internal class ProcessingPhase(
if (type.constructor != null && type.constructorExclusions.containsKey(type.constructor.meta.localId))
- fail("cannot use @JSON.Constructor and @JSON.Excluded on the same constructor")
+ fail("cannot use @Json.Constructor and @Json.Excluded on the same constructor")
val strategy = when (type.meta) {
is MClass -> when (type.annotation.decoding) {
- JSON.Decoding.annotatedConstructor ->
+ Json.Decoding.annotatedConstructor ->
type.constructor?.meta
?.let(::decodingStrategyForConstructor)
- ?: fail("type uses JSON.Decoding.annotatedConstructor but none was annotated with @JSON.Constructor")
+ ?: fail("type uses Json.Decoding.annotatedConstructor but none was annotated with @Json.Constructor")
- JSON.Decoding.automatic ->
+ Json.Decoding.automatic ->
(type.constructor?.meta
?: type.meta.primaryConstructor?.takeIf(MConstructor::isSuitableForAutomaticSelection)
?: type.meta.constructors
@@ -100,46 +100,46 @@ internal class ProcessingPhase(
.ifEmpty { null }
?.let { candidates ->
candidates.singleOrNull()
- ?: fail("multiple secondary constructors could be used for decoding so one must be marked explicitly with @JSON.Constructor")
+ ?: fail("multiple secondary constructors could be used for decoding so one must be marked explicitly with @Json.Constructor")
}
)
?.let(::decodingStrategyForConstructor)
- ?: fail("cannot find a constructor suitable for decoding so one should be provided or decoding be disabled using JSON.Decoding.none")
+ ?: fail("cannot find a constructor suitable for decoding so one should be provided or decoding be disabled using Json.Decoding.none")
- JSON.Decoding.none ->
+ Json.Decoding.none ->
null
- JSON.Decoding.primaryConstructor ->
+ Json.Decoding.primaryConstructor ->
type.meta.primaryConstructor
?.let(::decodingStrategyForConstructor)
- ?: fail("type uses @JSON.Decoding.primaryConstructor but has no primary constructor")
+ ?: fail("type uses @Json.Decoding.primaryConstructor but has no primary constructor")
}
is MObject -> when (type.annotation.decoding) {
- JSON.Decoding.annotatedConstructor ->
- fail("cannot use JSON.Decoding.annotatedConstructor with objects")
+ Json.Decoding.annotatedConstructor ->
+ fail("cannot use Json.Decoding.annotatedConstructor with objects")
- JSON.Decoding.automatic,
- JSON.Decoding.none ->
+ Json.Decoding.automatic,
+ Json.Decoding.none ->
null
- JSON.Decoding.primaryConstructor ->
- fail("cannot use JSON.Decoding.primaryConstructor with objects")
+ Json.Decoding.primaryConstructor ->
+ fail("cannot use Json.Decoding.primaryConstructor with objects")
}
- else -> fail("cannot use @JSON on this type")
+ else -> fail("cannot use @Json on this type")
}
if (strategy != null) {
if (type.constructor != null && type.constructor.meta.localId != strategy.meta.localId)
- fail("type uses JSON.Decoding.${type.annotation.decoding.name} but annotated a different constructor with @JSON.Constructor")
+ fail("type uses Json.Decoding.${type.annotation.decoding.name} but annotated a different constructor with @Json.Constructor")
if (type.constructorExclusions.containsKey(strategy.meta.localId))
- fail("type uses JSON.Decoding.${type.annotation.decoding.name} but selected constructor is annotated with @JSON.Excluded")
+ fail("type uses Json.Decoding.${type.annotation.decoding.name} but selected constructor is annotated with @Json.Excluded")
}
else {
if (type.constructor != null)
- fail("type is supposed to not be decodable but a constructor was annotated with @JSON.Constructor")
+ fail("type is supposed to not be decodable but a constructor was annotated with @Json.Constructor")
}
return strategy
@@ -195,34 +195,34 @@ internal class ProcessingPhase(
val metaProperties = (type.meta as? MPropertyContainer)?.properties
- ?: fail("cannot use @JSON on this type")
+ ?: fail("cannot use @Json on this type")
val strategy = when (type.annotation.encoding) {
- JSON.Encoding.allProperties ->
+ Json.Encoding.allProperties ->
encodingStrategyForProperties(
metaProperties.filter { it.isSuitableForAutomaticSelection(defaultOnly = false) } +
type.properties.values.map { it.meta }
)
- JSON.Encoding.annotatedProperties ->
+ Json.Encoding.annotatedProperties ->
encodingStrategyForProperties(
metaProperties.filter { type.decodableProperties.containsKey(it.name) } +
type.properties.values.map { it.meta }
)
- JSON.Encoding.automatic ->
+ Json.Encoding.automatic ->
encodingStrategyForProperties(
metaProperties.filter { it.isSuitableForAutomaticSelection(defaultOnly = true) } +
type.properties.values.map { it.meta }
)
- JSON.Encoding.none ->
+ Json.Encoding.none ->
null
}
if (strategy == null) {
if (type.customProperties.isNotEmpty())
- fail("type is supposed to not be encodable but methods have been annotated with @JSON.CustomProperties")
+ fail("type is supposed to not be encodable but methods have been annotated with @Json.CustomProperties")
val encodableOnlyProperties = when (decodingStrategy) {
null -> type.properties.values
@@ -230,7 +230,7 @@ internal class ProcessingPhase(
.filterNot { property -> decodingStrategy.properties.any { it.name == property.meta.name } }
}
if (encodableOnlyProperties.isNotEmpty())
- fail("type is supposed to not be encodable but properties have been annotated with @JSON.Property")
+ fail("type is supposed to not be encodable but properties have been annotated with @Json.Property")
}
return strategy
@@ -258,7 +258,7 @@ internal class ProcessingPhase(
@JvmName("processCodecProviders")
private fun process(results: Collection) {
for (result in results) {
- withFailureHandling(annotation = "JSON.CodecProvider", element = result.element) {
+ withFailureHandling(annotation = "Json.CodecProvider", element = result.element) {
process(result)
}
}
@@ -268,7 +268,7 @@ internal class ProcessingPhase(
@JvmName("processTypes")
private fun process(results: Collection) {
for (result in results) {
- withFailureHandling(annotation = "JSON", element = result.element) {
+ withFailureHandling(annotation = "Json", element = result.element) {
process(result)
}
}
@@ -295,7 +295,7 @@ internal class ProcessingPhase(
private fun process(type: CollectionResult.Type) {
val annotation = type.annotation
- val meta = type.meta as? MNamedType ?: fail("cannot use @JSON on this type")
+ val meta = type.meta as? MNamedType ?: fail("cannot use @Json on this type")
val decodingStrategy = decodingStrategyForType(type)
val encodingStrategy = encodingStrategyForType(type, decodingStrategy = decodingStrategy)
@@ -303,27 +303,27 @@ internal class ProcessingPhase(
fail("type is neither decodable nor encodable")
val isSingleValue = when (annotation.representation) {
- JSON.Representation.automatic -> meta is MInlineable && meta.isInline
- JSON.Representation.structured -> false
- JSON.Representation.singleValue -> true
+ Json.Representation.automatic -> meta is MInlineable && meta.isInline
+ Json.Representation.structured -> false
+ Json.Representation.singleValue -> true
}
if (isSingleValue) {
if (decodingStrategy != null && decodingStrategy.properties.size != 1)
- fail("class with JSON.Representation.singleValue must have exactly one decodable property")
+ fail("class with Json.Representation.singleValue must have exactly one decodable property")
if (encodingStrategy != null) {
if (encodingStrategy.properties.size != 1)
- fail("class with JSON.Representation.singleValue must have exactly one encodable property")
+ fail("class with Json.Representation.singleValue must have exactly one encodable property")
if (encodingStrategy.customPropertyMethods.isNotEmpty())
- fail("class with JSON.Representation.singleValue cannot use @JSON.CustomProperties")
+ fail("class with Json.Representation.singleValue cannot use @Json.CustomProperties")
}
}
val isPublic = when (annotation.codecVisibility) {
- JSON.CodecVisibility.automatic -> type.actualVisibility == MVisibility.PUBLIC
- JSON.CodecVisibility.internal -> false
- JSON.CodecVisibility.publicRequired -> true
+ Json.CodecVisibility.automatic -> type.actualVisibility == MVisibility.PUBLIC
+ Json.CodecVisibility.internal -> false
+ Json.CodecVisibility.publicRequired -> true
}
codecs += ProcessingResult.Codec(
@@ -339,7 +339,7 @@ internal class ProcessingPhase(
?: meta.name.packageName.kotlin,
typeName = annotation.codecName
.takeIf { it != "" }
- ?: meta.name.withoutPackage().kotlin.replace('.', '_') + "JSONCodec"
+ ?: meta.name.withoutPackage().kotlin.replace('.', '_') + "JsonCodec"
),
valueType = meta.name.forKotlinPoet().let {
if (meta is MGeneralizable && meta.typeParameters.isNotEmpty()) it.parameterizedBy(*Array(meta.typeParameters.size) { STAR })
diff --git a/annotation-processor/sources/processing/ProcessingResult.kt b/annotation-processor/sources/processing/ProcessingResult.kt
index 912557f..8002565 100644
--- a/annotation-processor/sources/processing/ProcessingResult.kt
+++ b/annotation-processor/sources/processing/ProcessingResult.kt
@@ -1,7 +1,7 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
-import com.github.fluidsonic.fluid.meta.*
import com.squareup.kotlinpoet.*
+import io.fluidsonic.meta.*
internal data class ProcessingResult(
diff --git a/annotation-processor/sources/utility/AnnotatedConstruct.kt b/annotation-processor/sources/utility/AnnotatedConstruct.kt
index cd39eab..2751585 100644
--- a/annotation-processor/sources/utility/AnnotatedConstruct.kt
+++ b/annotation-processor/sources/utility/AnnotatedConstruct.kt
@@ -1,6 +1,6 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
-import com.github.fluidsonic.fluid.meta.*
+import io.fluidsonic.meta.*
import javax.lang.model.*
diff --git a/annotation-processor/sources/utility/AnnotationMirror.kt b/annotation-processor/sources/utility/AnnotationMirror.kt
index 319a899..83a7748 100644
--- a/annotation-processor/sources/utility/AnnotationMirror.kt
+++ b/annotation-processor/sources/utility/AnnotationMirror.kt
@@ -1,4 +1,4 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
import javax.lang.model.element.*
diff --git a/annotation-processor/sources/utility/Any.kt b/annotation-processor/sources/utility/Any.kt
index 4d4baa9..693ff8d 100644
--- a/annotation-processor/sources/utility/Any.kt
+++ b/annotation-processor/sources/utility/Any.kt
@@ -1,4 +1,4 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
import kotlin.contracts.*
diff --git a/annotation-processor/sources/utility/Element.kt b/annotation-processor/sources/utility/Element.kt
index a4d8ee7..dd54f91 100644
--- a/annotation-processor/sources/utility/Element.kt
+++ b/annotation-processor/sources/utility/Element.kt
@@ -1,4 +1,4 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
import javax.lang.model.element.*
diff --git a/annotation-processor/sources/utility/ErrorLogger.kt b/annotation-processor/sources/utility/ErrorLogger.kt
index b1e6ff1..6c2c9c3 100644
--- a/annotation-processor/sources/utility/ErrorLogger.kt
+++ b/annotation-processor/sources/utility/ErrorLogger.kt
@@ -1,4 +1,4 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
internal interface ErrorLogger {
diff --git a/annotation-processor/sources/utility/ExecutableElement.kt b/annotation-processor/sources/utility/ExecutableElement.kt
index fb4a48d..3eab0f2 100644
--- a/annotation-processor/sources/utility/ExecutableElement.kt
+++ b/annotation-processor/sources/utility/ExecutableElement.kt
@@ -1,4 +1,4 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
import javax.lang.model.element.*
diff --git a/annotation-processor/sources/utility/KotlinpoetTypeNames.kt b/annotation-processor/sources/utility/KotlinpoetTypeNames.kt
index 522cf43..513181c 100644
--- a/annotation-processor/sources/utility/KotlinpoetTypeNames.kt
+++ b/annotation-processor/sources/utility/KotlinpoetTypeNames.kt
@@ -1,4 +1,4 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
import com.squareup.kotlinpoet.*
diff --git a/annotation-processor/sources/utility/MQualifiedTypeName.kt b/annotation-processor/sources/utility/MQualifiedTypeName.kt
index 7ab9e61..5ea1b40 100644
--- a/annotation-processor/sources/utility/MQualifiedTypeName.kt
+++ b/annotation-processor/sources/utility/MQualifiedTypeName.kt
@@ -1,7 +1,7 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
-import com.github.fluidsonic.fluid.meta.*
import com.squareup.kotlinpoet.*
+import io.fluidsonic.meta.*
internal fun MQualifiedTypeName.forKotlinPoet(nullable: Boolean = false) =
diff --git a/annotation-processor/sources/utility/MTypeReference.kt b/annotation-processor/sources/utility/MTypeReference.kt
index fc0f614..f50282d 100644
--- a/annotation-processor/sources/utility/MTypeReference.kt
+++ b/annotation-processor/sources/utility/MTypeReference.kt
@@ -1,8 +1,8 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
-import com.github.fluidsonic.fluid.meta.*
import com.squareup.kotlinpoet.*
import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy
+import io.fluidsonic.meta.*
internal fun MTypeReference.Class.forKotlinPoet(typeParameters: List): TypeName {
diff --git a/annotation-processor/sources/utility/TypeMirror.kt b/annotation-processor/sources/utility/TypeMirror.kt
index acf8372..4250274 100644
--- a/annotation-processor/sources/utility/TypeMirror.kt
+++ b/annotation-processor/sources/utility/TypeMirror.kt
@@ -1,4 +1,4 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
import javax.lang.model.element.*
import javax.lang.model.type.*
diff --git a/annotation-processor/sources/utility/TypeNames.kt b/annotation-processor/sources/utility/TypeNames.kt
index 82d22ad..c4f0d58 100644
--- a/annotation-processor/sources/utility/TypeNames.kt
+++ b/annotation-processor/sources/utility/TypeNames.kt
@@ -1,13 +1,13 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
-import com.github.fluidsonic.fluid.json.*
-import com.github.fluidsonic.fluid.meta.*
+import io.fluidsonic.json.*
+import io.fluidsonic.meta.*
internal object TypeNames {
val anyType = MQualifiedTypeName.of(Any::class)
- val codecProviderType = MQualifiedTypeName.of(JSONCodecProvider::class)
- val codingContext = MQualifiedTypeName.of(JSONCodingContext::class)
- val encoder = MQualifiedTypeName.of(JSONEncoder::class)
+ val codecProviderType = MQualifiedTypeName.of(JsonCodecProvider::class)
+ val codingContext = MQualifiedTypeName.of(JsonCodingContext::class)
+ val encoder = MQualifiedTypeName.of(JsonEncoder::class)
}
diff --git a/annotation-processor/sources/utility/TypeResolver.kt b/annotation-processor/sources/utility/TypeResolver.kt
index fb2e6d5..d172232 100644
--- a/annotation-processor/sources/utility/TypeResolver.kt
+++ b/annotation-processor/sources/utility/TypeResolver.kt
@@ -1,4 +1,4 @@
-package com.github.fluidsonic.fluid.json.annotationprocessor
+package io.fluidsonic.json.annotationprocessor
import javax.lang.model.element.*
diff --git a/annotation-processor/tests/cases/1/input/codecProvider/CustomContextCodecProvider.kt b/annotation-processor/tests/cases/1/input/codecProvider/CustomContextCodecProvider.kt
index 8d56928..2944fc6 100644
--- a/annotation-processor/tests/cases/1/input/codecProvider/CustomContextCodecProvider.kt
+++ b/annotation-processor/tests/cases/1/input/codecProvider/CustomContextCodecProvider.kt
@@ -1,23 +1,23 @@
package codecProvider
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON.CodecProvider(
+@Json.CodecProvider(
externalTypes = [
- JSON.ExternalType(KT30280::class, JSON(codecPackageName = "externalType"), targetName = "codecProvider.KT30280"),
- JSON.ExternalType(KT30280Primitive::class, JSON(codecPackageName = "externalType"), targetName = "codecProvider.KT30280Primitive"),
- JSON.ExternalType(Pair::class, JSON(
+ Json.ExternalType(KT30280::class, Json(codecPackageName = "externalType"), targetName = "codecProvider.KT30280"),
+ Json.ExternalType(KT30280Primitive::class, Json(codecPackageName = "externalType"), targetName = "codecProvider.KT30280Primitive"),
+ Json.ExternalType(Pair::class, Json(
codecName = "ExternalPairCodec",
codecPackageName = "externalType",
- codecVisibility = JSON.CodecVisibility.publicRequired
+ codecVisibility = Json.CodecVisibility.publicRequired
))
]
)
-interface CustomContextCodecProvider : JSONCodecProvider
+interface CustomContextCodecProvider : JsonCodecProvider
-interface CustomCodingContext : JSONCodingContext
+interface CustomCodingContext : JsonCodingContext
inline class KT30280(val value: String)
inline class KT30280Primitive(val value: Double)
diff --git a/annotation-processor/tests/cases/1/input/customProperties/CustomContext.kt b/annotation-processor/tests/cases/1/input/customProperties/CustomContext.kt
index dc6addc..e3d2651 100644
--- a/annotation-processor/tests/cases/1/input/customProperties/CustomContext.kt
+++ b/annotation-processor/tests/cases/1/input/customProperties/CustomContext.kt
@@ -1,16 +1,16 @@
package customProperties
import codecProvider.CustomCodingContext
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
class CustomContext(val value: String) {
- @JSON.CustomProperties
- internal fun JSONEncoder.writeCustomProperties1() = Unit
+ @Json.CustomProperties
+ internal fun JsonEncoder.writeCustomProperties1() = Unit
}
-@JSON.CustomProperties
-internal fun JSONEncoder.writeCustomProperties2(value: CustomContext) = Unit
+@Json.CustomProperties
+internal fun JsonEncoder.writeCustomProperties2(value: CustomContext) = Unit
diff --git a/annotation-processor/tests/cases/1/input/customProperties/DifferentPackage.kt b/annotation-processor/tests/cases/1/input/customProperties/DifferentPackage.kt
index e02a741..576e2a7 100644
--- a/annotation-processor/tests/cases/1/input/customProperties/DifferentPackage.kt
+++ b/annotation-processor/tests/cases/1/input/customProperties/DifferentPackage.kt
@@ -1,15 +1,15 @@
package customProperties
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
class DifferentPackage(val value: String) {
- @JSON.CustomProperties
- internal fun JSONEncoder.writeCustomProperties1() = Unit
+ @Json.CustomProperties
+ internal fun JsonEncoder.writeCustomProperties1() = Unit
}
-@JSON.CustomProperties
-internal fun JSONEncoder.writeCustomProperties2(value: DifferentPackage) = Unit
+@Json.CustomProperties
+internal fun JsonEncoder.writeCustomProperties2(value: DifferentPackage) = Unit
diff --git a/annotation-processor/tests/cases/1/input/customProperties/DifferentPackageExtensions.kt b/annotation-processor/tests/cases/1/input/customProperties/DifferentPackageExtensions.kt
index 1a7b391..523972f 100644
--- a/annotation-processor/tests/cases/1/input/customProperties/DifferentPackageExtensions.kt
+++ b/annotation-processor/tests/cases/1/input/customProperties/DifferentPackageExtensions.kt
@@ -1,8 +1,8 @@
package customProperties.differentPackage
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
import customProperties.DifferentPackage
-@JSON.CustomProperties
-internal fun JSONEncoder.writeCustomProperties3(value: DifferentPackage) = Unit
+@Json.CustomProperties
+internal fun JsonEncoder.writeCustomProperties3(value: DifferentPackage) = Unit
diff --git a/annotation-processor/tests/cases/1/input/customProperties/SamePackage.kt b/annotation-processor/tests/cases/1/input/customProperties/SamePackage.kt
index c66d28e..f4f9464 100644
--- a/annotation-processor/tests/cases/1/input/customProperties/SamePackage.kt
+++ b/annotation-processor/tests/cases/1/input/customProperties/SamePackage.kt
@@ -1,15 +1,15 @@
package customProperties
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
class SamePackage(val value: String) {
- @JSON.CustomProperties
- internal fun JSONEncoder.writeCustomProperties1() = Unit
+ @Json.CustomProperties
+ internal fun JsonEncoder.writeCustomProperties1() = Unit
}
-@JSON.CustomProperties
-internal fun JSONEncoder.writeCustomProperties2(value: SamePackage) = Unit
+@Json.CustomProperties
+internal fun JsonEncoder.writeCustomProperties2(value: SamePackage) = Unit
diff --git a/annotation-processor/tests/cases/1/input/json/classes/Class.kt b/annotation-processor/tests/cases/1/input/json/classes/Class.kt
index 4d6c7a6..2281a43 100644
--- a/annotation-processor/tests/cases/1/input/json/classes/Class.kt
+++ b/annotation-processor/tests/cases/1/input/json/classes/Class.kt
@@ -1,7 +1,7 @@
package json.classes
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
class Class(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/classes/DataClass.kt b/annotation-processor/tests/cases/1/input/json/classes/DataClass.kt
index 98050dd..0ebadec 100644
--- a/annotation-processor/tests/cases/1/input/json/classes/DataClass.kt
+++ b/annotation-processor/tests/cases/1/input/json/classes/DataClass.kt
@@ -1,7 +1,7 @@
package json.classes
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
data class DataClass(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/classes/GenericClass.kt b/annotation-processor/tests/cases/1/input/json/classes/GenericClass.kt
index 1b32993..d25ef80 100644
--- a/annotation-processor/tests/cases/1/input/json/classes/GenericClass.kt
+++ b/annotation-processor/tests/cases/1/input/json/classes/GenericClass.kt
@@ -1,9 +1,9 @@
package json.classes
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
data class GenericClass(
val a: A,
val b: B,
diff --git a/annotation-processor/tests/cases/1/input/json/classes/InlineClass.kt b/annotation-processor/tests/cases/1/input/json/classes/InlineClass.kt
index 649235c..517099c 100644
--- a/annotation-processor/tests/cases/1/input/json/classes/InlineClass.kt
+++ b/annotation-processor/tests/cases/1/input/json/classes/InlineClass.kt
@@ -1,7 +1,7 @@
package json.classes
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
inline class InlineClass(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/classes/Object.kt b/annotation-processor/tests/cases/1/input/json/classes/Object.kt
index c56961c..8d25042 100644
--- a/annotation-processor/tests/cases/1/input/json/classes/Object.kt
+++ b/annotation-processor/tests/cases/1/input/json/classes/Object.kt
@@ -1,9 +1,9 @@
package json.classes
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
object Object {
val value = ""
diff --git a/annotation-processor/tests/cases/1/input/json/codecName/Automatic.kt b/annotation-processor/tests/cases/1/input/json/codecName/Automatic.kt
index 6d07bfa..609369d 100644
--- a/annotation-processor/tests/cases/1/input/json/codecName/Automatic.kt
+++ b/annotation-processor/tests/cases/1/input/json/codecName/Automatic.kt
@@ -1,9 +1,9 @@
package json.codecName
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- codecName = JSON.automatic
+@Json(
+ codecName = Json.automatic
)
class Automatic(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/codecName/Custom.kt b/annotation-processor/tests/cases/1/input/json/codecName/Custom.kt
index e4f8e49..e185ac3 100644
--- a/annotation-processor/tests/cases/1/input/json/codecName/Custom.kt
+++ b/annotation-processor/tests/cases/1/input/json/codecName/Custom.kt
@@ -1,9 +1,9 @@
package json.codecName
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- codecName = "CustomizedJSONCodec"
+@Json(
+ codecName = "CustomizedJsonCodec"
)
class Custom(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/codecName/Default.kt b/annotation-processor/tests/cases/1/input/json/codecName/Default.kt
index 2429cab..738aa51 100644
--- a/annotation-processor/tests/cases/1/input/json/codecName/Default.kt
+++ b/annotation-processor/tests/cases/1/input/json/codecName/Default.kt
@@ -1,7 +1,7 @@
package json.codecName
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
class Default(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/codecPackageName/Automatic.kt b/annotation-processor/tests/cases/1/input/json/codecPackageName/Automatic.kt
index b9c79b1..672d672 100644
--- a/annotation-processor/tests/cases/1/input/json/codecPackageName/Automatic.kt
+++ b/annotation-processor/tests/cases/1/input/json/codecPackageName/Automatic.kt
@@ -1,9 +1,9 @@
package json.codecPackageName
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- codecPackageName = JSON.automatic
+@Json(
+ codecPackageName = Json.automatic
)
class Automatic(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/codecPackageName/AutomaticRoot.kt b/annotation-processor/tests/cases/1/input/json/codecPackageName/AutomaticRoot.kt
index 3ac6203..5624cdc 100644
--- a/annotation-processor/tests/cases/1/input/json/codecPackageName/AutomaticRoot.kt
+++ b/annotation-processor/tests/cases/1/input/json/codecPackageName/AutomaticRoot.kt
@@ -1,7 +1,7 @@
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- codecPackageName = JSON.automatic
+@Json(
+ codecPackageName = Json.automatic
)
class AutomaticRoot(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/codecPackageName/Custom.kt b/annotation-processor/tests/cases/1/input/json/codecPackageName/Custom.kt
index 63b356a..3e93629 100644
--- a/annotation-processor/tests/cases/1/input/json/codecPackageName/Custom.kt
+++ b/annotation-processor/tests/cases/1/input/json/codecPackageName/Custom.kt
@@ -1,9 +1,9 @@
package json.codecPackageName
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
+@Json(
codecPackageName = "json.codecPackageName.customized"
)
class Custom(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/codecPackageName/CustomRoot.kt b/annotation-processor/tests/cases/1/input/json/codecPackageName/CustomRoot.kt
index 3ff822e..9874e0e 100644
--- a/annotation-processor/tests/cases/1/input/json/codecPackageName/CustomRoot.kt
+++ b/annotation-processor/tests/cases/1/input/json/codecPackageName/CustomRoot.kt
@@ -1,9 +1,9 @@
package json.codecPackageName
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
+@Json(
codecPackageName = ""
)
class CustomRoot(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/codecPackageName/Default.kt b/annotation-processor/tests/cases/1/input/json/codecPackageName/Default.kt
index ec17901..8e1e4df 100644
--- a/annotation-processor/tests/cases/1/input/json/codecPackageName/Default.kt
+++ b/annotation-processor/tests/cases/1/input/json/codecPackageName/Default.kt
@@ -1,7 +1,7 @@
package json.codecPackageName
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
class Default(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/codecPackageName/DefaultRoot.kt b/annotation-processor/tests/cases/1/input/json/codecPackageName/DefaultRoot.kt
index a8f1e1c..a1b0b72 100644
--- a/annotation-processor/tests/cases/1/input/json/codecPackageName/DefaultRoot.kt
+++ b/annotation-processor/tests/cases/1/input/json/codecPackageName/DefaultRoot.kt
@@ -1,5 +1,5 @@
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
class DefaultRoot(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/codecVisibility/AutomaticInternal.kt b/annotation-processor/tests/cases/1/input/json/codecVisibility/AutomaticInternal.kt
index fe53132..78c55a2 100644
--- a/annotation-processor/tests/cases/1/input/json/codecVisibility/AutomaticInternal.kt
+++ b/annotation-processor/tests/cases/1/input/json/codecVisibility/AutomaticInternal.kt
@@ -1,9 +1,9 @@
package json.codecVisibility
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- codecVisibility = JSON.CodecVisibility.automatic
+@Json(
+ codecVisibility = Json.CodecVisibility.automatic
)
internal class AutomaticInternal(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/codecVisibility/AutomaticInternalForContainedClass.kt b/annotation-processor/tests/cases/1/input/json/codecVisibility/AutomaticInternalForContainedClass.kt
index 49ba070..3e1f49a 100644
--- a/annotation-processor/tests/cases/1/input/json/codecVisibility/AutomaticInternalForContainedClass.kt
+++ b/annotation-processor/tests/cases/1/input/json/codecVisibility/AutomaticInternalForContainedClass.kt
@@ -1,12 +1,12 @@
package json.codecVisibility
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
internal class AutomaticInternalForContainedClass {
- @JSON(
- codecVisibility = JSON.CodecVisibility.automatic
+ @Json(
+ codecVisibility = Json.CodecVisibility.automatic
)
class ContainedClass(val value: String)
}
diff --git a/annotation-processor/tests/cases/1/input/json/codecVisibility/AutomaticPublic.kt b/annotation-processor/tests/cases/1/input/json/codecVisibility/AutomaticPublic.kt
index cc47ef8..331fdd2 100644
--- a/annotation-processor/tests/cases/1/input/json/codecVisibility/AutomaticPublic.kt
+++ b/annotation-processor/tests/cases/1/input/json/codecVisibility/AutomaticPublic.kt
@@ -1,9 +1,9 @@
package json.codecVisibility
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- codecVisibility = JSON.CodecVisibility.automatic
+@Json(
+ codecVisibility = Json.CodecVisibility.automatic
)
class AutomaticPublic(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/codecVisibility/DefaultInternal.kt b/annotation-processor/tests/cases/1/input/json/codecVisibility/DefaultInternal.kt
index d1ddf1c..c34e4ac 100644
--- a/annotation-processor/tests/cases/1/input/json/codecVisibility/DefaultInternal.kt
+++ b/annotation-processor/tests/cases/1/input/json/codecVisibility/DefaultInternal.kt
@@ -1,7 +1,7 @@
package json.codecVisibility
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
class DefaultInternal(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/codecVisibility/Internal.kt b/annotation-processor/tests/cases/1/input/json/codecVisibility/Internal.kt
index e8726fa..edb7409 100644
--- a/annotation-processor/tests/cases/1/input/json/codecVisibility/Internal.kt
+++ b/annotation-processor/tests/cases/1/input/json/codecVisibility/Internal.kt
@@ -1,9 +1,9 @@
package json.codecVisibility
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- codecVisibility = JSON.CodecVisibility.internal
+@Json(
+ codecVisibility = Json.CodecVisibility.internal
)
class Internal(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/codecVisibility/Public.kt b/annotation-processor/tests/cases/1/input/json/codecVisibility/Public.kt
index f38d9f7..a28cbb7 100644
--- a/annotation-processor/tests/cases/1/input/json/codecVisibility/Public.kt
+++ b/annotation-processor/tests/cases/1/input/json/codecVisibility/Public.kt
@@ -1,9 +1,9 @@
package json.codecVisibility
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- codecVisibility = JSON.CodecVisibility.publicRequired
+@Json(
+ codecVisibility = Json.CodecVisibility.publicRequired
)
class Public(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/decoding/AnnotatedConstructor.kt b/annotation-processor/tests/cases/1/input/json/decoding/AnnotatedConstructor.kt
index 61ee4f1..be6485e 100644
--- a/annotation-processor/tests/cases/1/input/json/decoding/AnnotatedConstructor.kt
+++ b/annotation-processor/tests/cases/1/input/json/decoding/AnnotatedConstructor.kt
@@ -1,10 +1,10 @@
package json.decoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- decoding = JSON.Decoding.annotatedConstructor
+@Json(
+ decoding = Json.Decoding.annotatedConstructor
)
class AnnotatedConstructor(
val value: String
@@ -12,6 +12,6 @@ class AnnotatedConstructor(
constructor(value: Int) : this(value.toString())
- @JSON.Constructor
+ @Json.Constructor
constructor(value: Long) : this(value.toString())
}
diff --git a/annotation-processor/tests/cases/1/input/json/decoding/AutomaticAnnotatedConstructor.kt b/annotation-processor/tests/cases/1/input/json/decoding/AutomaticAnnotatedConstructor.kt
index 61d1342..67ae344 100644
--- a/annotation-processor/tests/cases/1/input/json/decoding/AutomaticAnnotatedConstructor.kt
+++ b/annotation-processor/tests/cases/1/input/json/decoding/AutomaticAnnotatedConstructor.kt
@@ -1,10 +1,10 @@
package json.decoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- decoding = JSON.Decoding.automatic
+@Json(
+ decoding = Json.Decoding.automatic
)
class AutomaticAnnotatedConstructor(
val value: String
@@ -12,6 +12,6 @@ class AutomaticAnnotatedConstructor(
constructor(value: Int) : this(value.toString())
- @JSON.Constructor
+ @Json.Constructor
constructor(value: Long) : this(value.toString())
}
diff --git a/annotation-processor/tests/cases/1/input/json/decoding/AutomaticObject.kt b/annotation-processor/tests/cases/1/input/json/decoding/AutomaticObject.kt
index da3f5a5..e975a5b 100644
--- a/annotation-processor/tests/cases/1/input/json/decoding/AutomaticObject.kt
+++ b/annotation-processor/tests/cases/1/input/json/decoding/AutomaticObject.kt
@@ -1,9 +1,9 @@
package json.decoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- decoding = JSON.Decoding.automatic
+@Json(
+ decoding = Json.Decoding.automatic
)
object AutomaticObject
diff --git a/annotation-processor/tests/cases/1/input/json/decoding/AutomaticPrimaryConstructor.kt b/annotation-processor/tests/cases/1/input/json/decoding/AutomaticPrimaryConstructor.kt
index c4dfb41..ef602ad 100644
--- a/annotation-processor/tests/cases/1/input/json/decoding/AutomaticPrimaryConstructor.kt
+++ b/annotation-processor/tests/cases/1/input/json/decoding/AutomaticPrimaryConstructor.kt
@@ -1,10 +1,10 @@
package json.decoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- decoding = JSON.Decoding.automatic
+@Json(
+ decoding = Json.Decoding.automatic
)
class AutomaticPrimaryConstructor(
val value: String
diff --git a/annotation-processor/tests/cases/1/input/json/decoding/AutomaticSecondaryConstructorPrimaryExcluded.kt b/annotation-processor/tests/cases/1/input/json/decoding/AutomaticSecondaryConstructorPrimaryExcluded.kt
index 8983196..43d7b3f 100644
--- a/annotation-processor/tests/cases/1/input/json/decoding/AutomaticSecondaryConstructorPrimaryExcluded.kt
+++ b/annotation-processor/tests/cases/1/input/json/decoding/AutomaticSecondaryConstructorPrimaryExcluded.kt
@@ -1,12 +1,12 @@
package json.decoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- decoding = JSON.Decoding.automatic
+@Json(
+ decoding = Json.Decoding.automatic
)
-class AutomaticSecondaryConstructorPrimaryExcluded @JSON.Excluded constructor(
+class AutomaticSecondaryConstructorPrimaryExcluded @Json.Excluded constructor(
val value: String
) {
diff --git a/annotation-processor/tests/cases/1/input/json/decoding/AutomaticSecondaryConstructorPrimaryInaccessible.kt b/annotation-processor/tests/cases/1/input/json/decoding/AutomaticSecondaryConstructorPrimaryInaccessible.kt
index 8109052..0c0c424 100644
--- a/annotation-processor/tests/cases/1/input/json/decoding/AutomaticSecondaryConstructorPrimaryInaccessible.kt
+++ b/annotation-processor/tests/cases/1/input/json/decoding/AutomaticSecondaryConstructorPrimaryInaccessible.kt
@@ -1,10 +1,10 @@
package json.decoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- decoding = JSON.Decoding.automatic
+@Json(
+ decoding = Json.Decoding.automatic
)
class AutomaticSecondaryConstructorPrimaryInaccessible private constructor(
val value: String
diff --git a/annotation-processor/tests/cases/1/input/json/decoding/AutomaticSecondaryConstructorPrimaryNotPresent.kt b/annotation-processor/tests/cases/1/input/json/decoding/AutomaticSecondaryConstructorPrimaryNotPresent.kt
index 586de18..a46b6ae 100644
--- a/annotation-processor/tests/cases/1/input/json/decoding/AutomaticSecondaryConstructorPrimaryNotPresent.kt
+++ b/annotation-processor/tests/cases/1/input/json/decoding/AutomaticSecondaryConstructorPrimaryNotPresent.kt
@@ -1,10 +1,10 @@
package json.decoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- decoding = JSON.Decoding.automatic
+@Json(
+ decoding = Json.Decoding.automatic
)
class AutomaticSecondaryConstructorPrimaryNotPresent {
diff --git a/annotation-processor/tests/cases/1/input/json/decoding/ConstructorParameterOrder.kt b/annotation-processor/tests/cases/1/input/json/decoding/ConstructorParameterOrder.kt
index cdf98f9..a74d032 100644
--- a/annotation-processor/tests/cases/1/input/json/decoding/ConstructorParameterOrder.kt
+++ b/annotation-processor/tests/cases/1/input/json/decoding/ConstructorParameterOrder.kt
@@ -1,11 +1,11 @@
package json.decoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
// check that finding the right constructor using reflection uses the correct order of parameters
-@JSON(
- encoding = JSON.Encoding.none
+@Json(
+ encoding = Json.Encoding.none
)
class ConstructorParameterOrder(
val b: String = "b",
diff --git a/annotation-processor/tests/cases/1/input/json/decoding/DefaultAnnotatedConstructor.kt b/annotation-processor/tests/cases/1/input/json/decoding/DefaultAnnotatedConstructor.kt
index 563af79..eba96f4 100644
--- a/annotation-processor/tests/cases/1/input/json/decoding/DefaultAnnotatedConstructor.kt
+++ b/annotation-processor/tests/cases/1/input/json/decoding/DefaultAnnotatedConstructor.kt
@@ -1,15 +1,15 @@
package json.decoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
class DefaultAnnotatedConstructor(
val value: String
) {
constructor(value: Int) : this(value.toString())
- @JSON.Constructor
+ @Json.Constructor
constructor(value: Long) : this(value.toString())
}
diff --git a/annotation-processor/tests/cases/1/input/json/decoding/DefaultObject.kt b/annotation-processor/tests/cases/1/input/json/decoding/DefaultObject.kt
index 872b147..287b11b 100644
--- a/annotation-processor/tests/cases/1/input/json/decoding/DefaultObject.kt
+++ b/annotation-processor/tests/cases/1/input/json/decoding/DefaultObject.kt
@@ -1,7 +1,7 @@
package json.decoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
object DefaultObject
diff --git a/annotation-processor/tests/cases/1/input/json/decoding/DefaultPrimaryConstructor.kt b/annotation-processor/tests/cases/1/input/json/decoding/DefaultPrimaryConstructor.kt
index 8d24585..43d74ea 100644
--- a/annotation-processor/tests/cases/1/input/json/decoding/DefaultPrimaryConstructor.kt
+++ b/annotation-processor/tests/cases/1/input/json/decoding/DefaultPrimaryConstructor.kt
@@ -1,9 +1,9 @@
package json.decoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
class DefaultPrimaryConstructor(
val value: String
)
diff --git a/annotation-processor/tests/cases/1/input/json/decoding/DefaultSecondaryConstructorPrimaryExcluded.kt b/annotation-processor/tests/cases/1/input/json/decoding/DefaultSecondaryConstructorPrimaryExcluded.kt
index 81c886a..60f832d 100644
--- a/annotation-processor/tests/cases/1/input/json/decoding/DefaultSecondaryConstructorPrimaryExcluded.kt
+++ b/annotation-processor/tests/cases/1/input/json/decoding/DefaultSecondaryConstructorPrimaryExcluded.kt
@@ -1,10 +1,10 @@
package json.decoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
-class DefaultSecondaryConstructorPrimaryExcluded @JSON.Excluded constructor(
+@Json
+class DefaultSecondaryConstructorPrimaryExcluded @Json.Excluded constructor(
val value: String
) {
diff --git a/annotation-processor/tests/cases/1/input/json/decoding/DefaultSecondaryConstructorPrimaryInaccessible.kt b/annotation-processor/tests/cases/1/input/json/decoding/DefaultSecondaryConstructorPrimaryInaccessible.kt
index acfe16d..0ca4791 100644
--- a/annotation-processor/tests/cases/1/input/json/decoding/DefaultSecondaryConstructorPrimaryInaccessible.kt
+++ b/annotation-processor/tests/cases/1/input/json/decoding/DefaultSecondaryConstructorPrimaryInaccessible.kt
@@ -1,9 +1,9 @@
package json.decoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
class DefaultSecondaryConstructorPrimaryInaccessible private constructor(
val value: String
) {
diff --git a/annotation-processor/tests/cases/1/input/json/decoding/DefaultSecondaryConstructorPrimaryNotPresent.kt b/annotation-processor/tests/cases/1/input/json/decoding/DefaultSecondaryConstructorPrimaryNotPresent.kt
index f739388..a611be8 100644
--- a/annotation-processor/tests/cases/1/input/json/decoding/DefaultSecondaryConstructorPrimaryNotPresent.kt
+++ b/annotation-processor/tests/cases/1/input/json/decoding/DefaultSecondaryConstructorPrimaryNotPresent.kt
@@ -1,9 +1,9 @@
package json.decoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
class DefaultSecondaryConstructorPrimaryNotPresent {
var value = ""
diff --git a/annotation-processor/tests/cases/1/input/json/decoding/None.kt b/annotation-processor/tests/cases/1/input/json/decoding/None.kt
index 6ef2f09..b594c9c 100644
--- a/annotation-processor/tests/cases/1/input/json/decoding/None.kt
+++ b/annotation-processor/tests/cases/1/input/json/decoding/None.kt
@@ -1,10 +1,10 @@
package json.decoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- decoding = JSON.Decoding.none
+@Json(
+ decoding = Json.Decoding.none
)
class None(
val value: String
diff --git a/annotation-processor/tests/cases/1/input/json/decoding/PrimaryConstructor.kt b/annotation-processor/tests/cases/1/input/json/decoding/PrimaryConstructor.kt
index 27b952a..5680611 100644
--- a/annotation-processor/tests/cases/1/input/json/decoding/PrimaryConstructor.kt
+++ b/annotation-processor/tests/cases/1/input/json/decoding/PrimaryConstructor.kt
@@ -1,10 +1,10 @@
package json.decoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- decoding = JSON.Decoding.primaryConstructor
+@Json(
+ decoding = Json.Decoding.primaryConstructor
)
class PrimaryConstructor(
val value: String
diff --git a/annotation-processor/tests/cases/1/input/json/encoding/AllProperties.kt b/annotation-processor/tests/cases/1/input/json/encoding/AllProperties.kt
index 0ccc583..4df2ceb 100644
--- a/annotation-processor/tests/cases/1/input/json/encoding/AllProperties.kt
+++ b/annotation-processor/tests/cases/1/input/json/encoding/AllProperties.kt
@@ -1,11 +1,11 @@
package json.encoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
import java.io.Serializable
-@JSON(
- encoding = JSON.Encoding.allProperties
+@Json(
+ encoding = Json.Encoding.allProperties
)
class AllProperties(
val value1: String
@@ -13,7 +13,7 @@ class AllProperties(
val value2 = ""
- @JSON.Excluded
+ @Json.Excluded
val value3 = ""
private val value4 = ""
@@ -21,7 +21,7 @@ class AllProperties(
val value5
get() = ""
- @JSON.Property
+ @Json.Property
val value6
get() = ""
@@ -32,6 +32,6 @@ class AllProperties(
val AllProperties.value8
get() = ""
-@JSON.Property
+@Json.Property
val AllProperties.value9
get() = ""
diff --git a/annotation-processor/tests/cases/1/input/json/encoding/AnnotatedProperties.kt b/annotation-processor/tests/cases/1/input/json/encoding/AnnotatedProperties.kt
index ed70a46..9e66ab9 100644
--- a/annotation-processor/tests/cases/1/input/json/encoding/AnnotatedProperties.kt
+++ b/annotation-processor/tests/cases/1/input/json/encoding/AnnotatedProperties.kt
@@ -1,11 +1,11 @@
package json.encoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
import java.io.Serializable
-@JSON(
- encoding = JSON.Encoding.annotatedProperties
+@Json(
+ encoding = Json.Encoding.annotatedProperties
)
class AnnotatedProperties(
val value1: String
@@ -13,7 +13,7 @@ class AnnotatedProperties(
val value2 = ""
- @JSON.Property
+ @Json.Property
val value3 = ""
private val value4 = ""
@@ -21,7 +21,7 @@ class AnnotatedProperties(
val value5
get() = ""
- @JSON.Property
+ @Json.Property
val value6
get() = ""
@@ -32,6 +32,6 @@ class AnnotatedProperties(
val AnnotatedProperties.value8
get() = ""
-@JSON.Property
+@Json.Property
val AnnotatedProperties.value9
get() = ""
diff --git a/annotation-processor/tests/cases/1/input/json/encoding/Automatic.kt b/annotation-processor/tests/cases/1/input/json/encoding/Automatic.kt
index 46cfce9..633ad66 100644
--- a/annotation-processor/tests/cases/1/input/json/encoding/Automatic.kt
+++ b/annotation-processor/tests/cases/1/input/json/encoding/Automatic.kt
@@ -1,11 +1,11 @@
package json.encoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
import java.io.Serializable
-@JSON(
- encoding = JSON.Encoding.automatic
+@Json(
+ encoding = Json.Encoding.automatic
)
class Automatic(
val value1: String
@@ -13,7 +13,7 @@ class Automatic(
val value2 = ""
- @JSON.Excluded
+ @Json.Excluded
val value3 = ""
private val value4 = ""
@@ -21,7 +21,7 @@ class Automatic(
val value5
get() = ""
- @JSON.Property
+ @Json.Property
val value6
get() = ""
@@ -32,6 +32,6 @@ class Automatic(
val Automatic.value8
get() = ""
-@JSON.Property
+@Json.Property
val Automatic.value9
get() = ""
diff --git a/annotation-processor/tests/cases/1/input/json/encoding/Default.kt b/annotation-processor/tests/cases/1/input/json/encoding/Default.kt
index 91646ce..bb4bb6a 100644
--- a/annotation-processor/tests/cases/1/input/json/encoding/Default.kt
+++ b/annotation-processor/tests/cases/1/input/json/encoding/Default.kt
@@ -1,17 +1,17 @@
package json.encoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
import java.io.Serializable
-@JSON
+@Json
class Default(
val value1: String
) : Serializable by "" {
val value2 = ""
- @JSON.Excluded
+ @Json.Excluded
val value3 = ""
private val value4 = ""
@@ -19,7 +19,7 @@ class Default(
val value5
get() = ""
- @JSON.Property
+ @Json.Property
val value6
get() = ""
@@ -30,6 +30,6 @@ class Default(
val Default.value8
get() = ""
-@JSON.Property
+@Json.Property
val Default.value9
get() = ""
diff --git a/annotation-processor/tests/cases/1/input/json/encoding/None.kt b/annotation-processor/tests/cases/1/input/json/encoding/None.kt
index 5dcddd4..2a1b964 100644
--- a/annotation-processor/tests/cases/1/input/json/encoding/None.kt
+++ b/annotation-processor/tests/cases/1/input/json/encoding/None.kt
@@ -1,11 +1,11 @@
package json.encoding
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
import java.io.Serializable
-@JSON(
- encoding = JSON.Encoding.none
+@Json(
+ encoding = Json.Encoding.none
)
class None(
val value1: String
diff --git a/annotation-processor/tests/cases/1/input/json/representation/AutomaticSingleValue.kt b/annotation-processor/tests/cases/1/input/json/representation/AutomaticSingleValue.kt
index 15971c9..8603a67 100644
--- a/annotation-processor/tests/cases/1/input/json/representation/AutomaticSingleValue.kt
+++ b/annotation-processor/tests/cases/1/input/json/representation/AutomaticSingleValue.kt
@@ -1,9 +1,9 @@
package json.representation
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- representation = JSON.Representation.automatic
+@Json(
+ representation = Json.Representation.automatic
)
inline class AutomaticSingleValue(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/representation/AutomaticStructured.kt b/annotation-processor/tests/cases/1/input/json/representation/AutomaticStructured.kt
index 9ad799f..4415112 100644
--- a/annotation-processor/tests/cases/1/input/json/representation/AutomaticStructured.kt
+++ b/annotation-processor/tests/cases/1/input/json/representation/AutomaticStructured.kt
@@ -1,9 +1,9 @@
package json.representation
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- representation = JSON.Representation.automatic
+@Json(
+ representation = Json.Representation.automatic
)
class AutomaticStructured(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/representation/DefaultSingleValue.kt b/annotation-processor/tests/cases/1/input/json/representation/DefaultSingleValue.kt
index fe647ad..81aac8d 100644
--- a/annotation-processor/tests/cases/1/input/json/representation/DefaultSingleValue.kt
+++ b/annotation-processor/tests/cases/1/input/json/representation/DefaultSingleValue.kt
@@ -1,7 +1,7 @@
package json.representation
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
class DefaultSingleValue(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/representation/DefaultStructured.kt b/annotation-processor/tests/cases/1/input/json/representation/DefaultStructured.kt
index 11d8e05..3c67090 100644
--- a/annotation-processor/tests/cases/1/input/json/representation/DefaultStructured.kt
+++ b/annotation-processor/tests/cases/1/input/json/representation/DefaultStructured.kt
@@ -1,7 +1,7 @@
package json.representation
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
class DefaultStructured(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/representation/SingleValue.kt b/annotation-processor/tests/cases/1/input/json/representation/SingleValue.kt
index 971cdac..7c54360 100644
--- a/annotation-processor/tests/cases/1/input/json/representation/SingleValue.kt
+++ b/annotation-processor/tests/cases/1/input/json/representation/SingleValue.kt
@@ -1,9 +1,9 @@
package json.representation
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- representation = JSON.Representation.singleValue
+@Json(
+ representation = Json.Representation.singleValue
)
class SingleValue(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/representation/SingleValueGeneric.kt b/annotation-processor/tests/cases/1/input/json/representation/SingleValueGeneric.kt
index d42ec83..41706a3 100644
--- a/annotation-processor/tests/cases/1/input/json/representation/SingleValueGeneric.kt
+++ b/annotation-processor/tests/cases/1/input/json/representation/SingleValueGeneric.kt
@@ -1,10 +1,10 @@
package json.representation
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- representation = JSON.Representation.singleValue
+@Json(
+ representation = Json.Representation.singleValue
)
class SingleValueGeneric(val value: Value) {
diff --git a/annotation-processor/tests/cases/1/input/json/representation/SingleValueNullable.kt b/annotation-processor/tests/cases/1/input/json/representation/SingleValueNullable.kt
index 114f80a..0e9fc30 100644
--- a/annotation-processor/tests/cases/1/input/json/representation/SingleValueNullable.kt
+++ b/annotation-processor/tests/cases/1/input/json/representation/SingleValueNullable.kt
@@ -1,9 +1,9 @@
package json.representation
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- representation = JSON.Representation.singleValue
+@Json(
+ representation = Json.Representation.singleValue
)
class SingleValueNullable(val value: String?)
diff --git a/annotation-processor/tests/cases/1/input/json/representation/Structured.kt b/annotation-processor/tests/cases/1/input/json/representation/Structured.kt
index 05b369e..3de5013 100644
--- a/annotation-processor/tests/cases/1/input/json/representation/Structured.kt
+++ b/annotation-processor/tests/cases/1/input/json/representation/Structured.kt
@@ -1,9 +1,9 @@
package json.representation
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- representation = JSON.Representation.structured
+@Json(
+ representation = Json.Representation.structured
)
inline class Structured(val value: String)
diff --git a/annotation-processor/tests/cases/1/input/json/representation/StructuredValueGeneric.kt b/annotation-processor/tests/cases/1/input/json/representation/StructuredValueGeneric.kt
index 101397a..c97a6c7 100644
--- a/annotation-processor/tests/cases/1/input/json/representation/StructuredValueGeneric.kt
+++ b/annotation-processor/tests/cases/1/input/json/representation/StructuredValueGeneric.kt
@@ -1,9 +1,9 @@
package json.representation
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON(
- representation = JSON.Representation.structured
+@Json(
+ representation = Json.Representation.structured
)
class StructuredValueGeneric(val value: Value)
diff --git a/annotation-processor/tests/cases/1/input/property/defaultValue/Automatic.kt b/annotation-processor/tests/cases/1/input/property/defaultValue/Automatic.kt
index 9758af9..a5a9c74 100644
--- a/annotation-processor/tests/cases/1/input/property/defaultValue/Automatic.kt
+++ b/annotation-processor/tests/cases/1/input/property/defaultValue/Automatic.kt
@@ -1,9 +1,9 @@
package property.defaultValue
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
class Automatic(
val value1: String,
val value2: String = "",
diff --git a/annotation-processor/tests/cases/1/input/property/defaultValue/AutomaticGeneric.kt b/annotation-processor/tests/cases/1/input/property/defaultValue/AutomaticGeneric.kt
index 9e403f8..a5e9ea4 100644
--- a/annotation-processor/tests/cases/1/input/property/defaultValue/AutomaticGeneric.kt
+++ b/annotation-processor/tests/cases/1/input/property/defaultValue/AutomaticGeneric.kt
@@ -1,9 +1,9 @@
package property.defaultValue
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
class AutomaticGeneric(
val value1: T,
val value2: T = error(""),
diff --git a/annotation-processor/tests/cases/1/input/property/serializedName/Automatic.kt b/annotation-processor/tests/cases/1/input/property/serializedName/Automatic.kt
index 62f7e90..3c14026 100644
--- a/annotation-processor/tests/cases/1/input/property/serializedName/Automatic.kt
+++ b/annotation-processor/tests/cases/1/input/property/serializedName/Automatic.kt
@@ -1,14 +1,14 @@
package property.serializedName
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
class Automatic(
- @JSON.Property(serializedName = JSON.automatic)
+ @Json.Property(serializedName = Json.automatic)
val value1: String
) {
- @JSON.Property(serializedName = JSON.automatic)
+ @Json.Property(serializedName = Json.automatic)
val value2 = ""
}
diff --git a/annotation-processor/tests/cases/1/input/property/serializedName/Custom.kt b/annotation-processor/tests/cases/1/input/property/serializedName/Custom.kt
index dcf30f6..4c2f1c6 100644
--- a/annotation-processor/tests/cases/1/input/property/serializedName/Custom.kt
+++ b/annotation-processor/tests/cases/1/input/property/serializedName/Custom.kt
@@ -1,14 +1,14 @@
package property.serializedName
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
class Custom(
- @JSON.Property(serializedName = "V A L U E 1")
+ @Json.Property(serializedName = "V A L U E 1")
val value1: String
) {
- @JSON.Property(serializedName = "V A L U E 2")
+ @Json.Property(serializedName = "V A L U E 2")
val value2 = ""
}
diff --git a/annotation-processor/tests/cases/1/input/property/serializedName/Default.kt b/annotation-processor/tests/cases/1/input/property/serializedName/Default.kt
index 2cb579b..50a5f7f 100644
--- a/annotation-processor/tests/cases/1/input/property/serializedName/Default.kt
+++ b/annotation-processor/tests/cases/1/input/property/serializedName/Default.kt
@@ -1,14 +1,14 @@
package property.serializedName
-import com.github.fluidsonic.fluid.json.*
+import io.fluidsonic.json.*
-@JSON
+@Json
class Default(
- @JSON.Property
+ @Json.Property
val value1: String
) {
- @JSON.Property
+ @Json.Property
val value2 = ""
}
diff --git a/annotation-processor/tests/cases/1/output-expected/AutomaticRootJSONCodec.kt b/annotation-processor/tests/cases/1/output-expected/AutomaticRootJSONCodec.kt
deleted file mode 100644
index c009cfb..0000000
--- a/annotation-processor/tests/cases/1/output-expected/AutomaticRootJSONCodec.kt
+++ /dev/null
@@ -1,55 +0,0 @@
-import codecProvider.CustomCodingContext
-import com.github.fluidsonic.fluid.json.AbstractJSONCodec
-import com.github.fluidsonic.fluid.json.JSONCodingType
-import com.github.fluidsonic.fluid.json.JSONDecoder
-import com.github.fluidsonic.fluid.json.JSONEncoder
-import com.github.fluidsonic.fluid.json.missingPropertyError
-import com.github.fluidsonic.fluid.json.readBooleanOrNull
-import com.github.fluidsonic.fluid.json.readByteOrNull
-import com.github.fluidsonic.fluid.json.readCharOrNull
-import com.github.fluidsonic.fluid.json.readDoubleOrNull
-import com.github.fluidsonic.fluid.json.readFloatOrNull
-import com.github.fluidsonic.fluid.json.readFromMapByElementValue
-import com.github.fluidsonic.fluid.json.readIntOrNull
-import com.github.fluidsonic.fluid.json.readLongOrNull
-import com.github.fluidsonic.fluid.json.readShortOrNull
-import com.github.fluidsonic.fluid.json.readStringOrNull
-import com.github.fluidsonic.fluid.json.readValueOfType
-import com.github.fluidsonic.fluid.json.readValueOfTypeOrNull
-import com.github.fluidsonic.fluid.json.writeBooleanOrNull
-import com.github.fluidsonic.fluid.json.writeByteOrNull
-import com.github.fluidsonic.fluid.json.writeCharOrNull
-import com.github.fluidsonic.fluid.json.writeDoubleOrNull
-import com.github.fluidsonic.fluid.json.writeFloatOrNull
-import com.github.fluidsonic.fluid.json.writeIntOrNull
-import com.github.fluidsonic.fluid.json.writeIntoMap
-import com.github.fluidsonic.fluid.json.writeLongOrNull
-import com.github.fluidsonic.fluid.json.writeMapElement
-import com.github.fluidsonic.fluid.json.writeShortOrNull
-import com.github.fluidsonic.fluid.json.writeStringOrNull
-import com.github.fluidsonic.fluid.json.writeValueOrNull
-import kotlin.String
-
-internal object AutomaticRootJSONCodec : AbstractJSONCodec() {
- override fun JSONDecoder.decode(valueType: JSONCodingType):
- AutomaticRoot {
- var _value: String? = null
-
- readFromMapByElementValue { key ->
- when (key) {
- "value" -> _value = readString()
- else -> skipValue()
- }
- }
-
- return AutomaticRoot(
- value = _value ?: missingPropertyError("value")
- )
- }
-
- override fun JSONEncoder.encode(value: AutomaticRoot) {
- writeIntoMap {
- writeMapElement("value", string = value.value)
- }
- }
-}
diff --git a/annotation-processor/tests/cases/1/output-expected/AutomaticRootJsonCodec.kt b/annotation-processor/tests/cases/1/output-expected/AutomaticRootJsonCodec.kt
new file mode 100644
index 0000000..0374bd9
--- /dev/null
+++ b/annotation-processor/tests/cases/1/output-expected/AutomaticRootJsonCodec.kt
@@ -0,0 +1,55 @@
+import codecProvider.CustomCodingContext
+import io.fluidsonic.json.AbstractJsonCodec
+import io.fluidsonic.json.JsonCodingType
+import io.fluidsonic.json.JsonDecoder
+import io.fluidsonic.json.JsonEncoder
+import io.fluidsonic.json.missingPropertyError
+import io.fluidsonic.json.readBooleanOrNull
+import io.fluidsonic.json.readByteOrNull
+import io.fluidsonic.json.readCharOrNull
+import io.fluidsonic.json.readDoubleOrNull
+import io.fluidsonic.json.readFloatOrNull
+import io.fluidsonic.json.readFromMapByElementValue
+import io.fluidsonic.json.readIntOrNull
+import io.fluidsonic.json.readLongOrNull
+import io.fluidsonic.json.readShortOrNull
+import io.fluidsonic.json.readStringOrNull
+import io.fluidsonic.json.readValueOfType
+import io.fluidsonic.json.readValueOfTypeOrNull
+import io.fluidsonic.json.writeBooleanOrNull
+import io.fluidsonic.json.writeByteOrNull
+import io.fluidsonic.json.writeCharOrNull
+import io.fluidsonic.json.writeDoubleOrNull
+import io.fluidsonic.json.writeFloatOrNull
+import io.fluidsonic.json.writeIntOrNull
+import io.fluidsonic.json.writeIntoMap
+import io.fluidsonic.json.writeLongOrNull
+import io.fluidsonic.json.writeMapElement
+import io.fluidsonic.json.writeShortOrNull
+import io.fluidsonic.json.writeStringOrNull
+import io.fluidsonic.json.writeValueOrNull
+import kotlin.String
+
+internal object AutomaticRootJsonCodec : AbstractJsonCodec() {
+ override fun JsonDecoder.decode(valueType: JsonCodingType):
+ AutomaticRoot {
+ var _value: String? = null
+
+ readFromMapByElementValue { key ->
+ when (key) {
+ "value" -> _value = readString()
+ else -> skipValue()
+ }
+ }
+
+ return AutomaticRoot(
+ value = _value ?: missingPropertyError("value")
+ )
+ }
+
+ override fun JsonEncoder.encode(value: AutomaticRoot) {
+ writeIntoMap {
+ writeMapElement("value", string = value.value)
+ }
+ }
+}
diff --git a/annotation-processor/tests/cases/1/output-expected/CustomRootJSONCodec.kt b/annotation-processor/tests/cases/1/output-expected/CustomRootJSONCodec.kt
deleted file mode 100644
index 8734bcb..0000000
--- a/annotation-processor/tests/cases/1/output-expected/CustomRootJSONCodec.kt
+++ /dev/null
@@ -1,56 +0,0 @@
-import codecProvider.CustomCodingContext
-import com.github.fluidsonic.fluid.json.AbstractJSONCodec
-import com.github.fluidsonic.fluid.json.JSONCodingType
-import com.github.fluidsonic.fluid.json.JSONDecoder
-import com.github.fluidsonic.fluid.json.JSONEncoder
-import com.github.fluidsonic.fluid.json.missingPropertyError
-import com.github.fluidsonic.fluid.json.readBooleanOrNull
-import com.github.fluidsonic.fluid.json.readByteOrNull
-import com.github.fluidsonic.fluid.json.readCharOrNull
-import com.github.fluidsonic.fluid.json.readDoubleOrNull
-import com.github.fluidsonic.fluid.json.readFloatOrNull
-import com.github.fluidsonic.fluid.json.readFromMapByElementValue
-import com.github.fluidsonic.fluid.json.readIntOrNull
-import com.github.fluidsonic.fluid.json.readLongOrNull
-import com.github.fluidsonic.fluid.json.readShortOrNull
-import com.github.fluidsonic.fluid.json.readStringOrNull
-import com.github.fluidsonic.fluid.json.readValueOfType
-import com.github.fluidsonic.fluid.json.readValueOfTypeOrNull
-import com.github.fluidsonic.fluid.json.writeBooleanOrNull
-import com.github.fluidsonic.fluid.json.writeByteOrNull
-import com.github.fluidsonic.fluid.json.writeCharOrNull
-import com.github.fluidsonic.fluid.json.writeDoubleOrNull
-import com.github.fluidsonic.fluid.json.writeFloatOrNull
-import com.github.fluidsonic.fluid.json.writeIntOrNull
-import com.github.fluidsonic.fluid.json.writeIntoMap
-import com.github.fluidsonic.fluid.json.writeLongOrNull
-import com.github.fluidsonic.fluid.json.writeMapElement
-import com.github.fluidsonic.fluid.json.writeShortOrNull
-import com.github.fluidsonic.fluid.json.writeStringOrNull
-import com.github.fluidsonic.fluid.json.writeValueOrNull
-import json.codecPackageName.CustomRoot
-import kotlin.String
-
-internal object CustomRootJSONCodec : AbstractJSONCodec() {
- override fun JSONDecoder.decode(valueType: JSONCodingType):
- CustomRoot {
- var _value: String? = null
-
- readFromMapByElementValue { key ->
- when (key) {
- "value" -> _value = readString()
- else -> skipValue()
- }
- }
-
- return CustomRoot(
- value = _value ?: missingPropertyError("value")
- )
- }
-
- override fun JSONEncoder.encode(value: CustomRoot) {
- writeIntoMap {
- writeMapElement("value", string = value.value)
- }
- }
-}
diff --git a/annotation-processor/tests/cases/1/output-expected/CustomRootJsonCodec.kt b/annotation-processor/tests/cases/1/output-expected/CustomRootJsonCodec.kt
new file mode 100644
index 0000000..fcb2ad4
--- /dev/null
+++ b/annotation-processor/tests/cases/1/output-expected/CustomRootJsonCodec.kt
@@ -0,0 +1,56 @@
+import codecProvider.CustomCodingContext
+import io.fluidsonic.json.AbstractJsonCodec
+import io.fluidsonic.json.JsonCodingType
+import io.fluidsonic.json.JsonDecoder
+import io.fluidsonic.json.JsonEncoder
+import io.fluidsonic.json.missingPropertyError
+import io.fluidsonic.json.readBooleanOrNull
+import io.fluidsonic.json.readByteOrNull
+import io.fluidsonic.json.readCharOrNull
+import io.fluidsonic.json.readDoubleOrNull
+import io.fluidsonic.json.readFloatOrNull
+import io.fluidsonic.json.readFromMapByElementValue
+import io.fluidsonic.json.readIntOrNull
+import io.fluidsonic.json.readLongOrNull
+import io.fluidsonic.json.readShortOrNull
+import io.fluidsonic.json.readStringOrNull
+import io.fluidsonic.json.readValueOfType
+import io.fluidsonic.json.readValueOfTypeOrNull
+import io.fluidsonic.json.writeBooleanOrNull
+import io.fluidsonic.json.writeByteOrNull
+import io.fluidsonic.json.writeCharOrNull
+import io.fluidsonic.json.writeDoubleOrNull
+import io.fluidsonic.json.writeFloatOrNull
+import io.fluidsonic.json.writeIntOrNull
+import io.fluidsonic.json.writeIntoMap
+import io.fluidsonic.json.writeLongOrNull
+import io.fluidsonic.json.writeMapElement
+import io.fluidsonic.json.writeShortOrNull
+import io.fluidsonic.json.writeStringOrNull
+import io.fluidsonic.json.writeValueOrNull
+import json.codecPackageName.CustomRoot
+import kotlin.String
+
+internal object CustomRootJsonCodec : AbstractJsonCodec() {
+ override fun JsonDecoder.decode(valueType: JsonCodingType):
+ CustomRoot {
+ var _value: String? = null
+
+ readFromMapByElementValue { key ->
+ when (key) {
+ "value" -> _value = readString()
+ else -> skipValue()
+ }
+ }
+
+ return CustomRoot(
+ value = _value ?: missingPropertyError("value")
+ )
+ }
+
+ override fun JsonEncoder.encode(value: CustomRoot) {
+ writeIntoMap {
+ writeMapElement("value", string = value.value)
+ }
+ }
+}
diff --git a/annotation-processor/tests/cases/1/output-expected/DefaultRootJSONCodec.kt b/annotation-processor/tests/cases/1/output-expected/DefaultRootJSONCodec.kt
deleted file mode 100644
index 183d337..0000000
--- a/annotation-processor/tests/cases/1/output-expected/DefaultRootJSONCodec.kt
+++ /dev/null
@@ -1,55 +0,0 @@
-import codecProvider.CustomCodingContext
-import com.github.fluidsonic.fluid.json.AbstractJSONCodec
-import com.github.fluidsonic.fluid.json.JSONCodingType
-import com.github.fluidsonic.fluid.json.JSONDecoder
-import com.github.fluidsonic.fluid.json.JSONEncoder
-import com.github.fluidsonic.fluid.json.missingPropertyError
-import com.github.fluidsonic.fluid.json.readBooleanOrNull
-import com.github.fluidsonic.fluid.json.readByteOrNull
-import com.github.fluidsonic.fluid.json.readCharOrNull
-import com.github.fluidsonic.fluid.json.readDoubleOrNull
-import com.github.fluidsonic.fluid.json.readFloatOrNull
-import com.github.fluidsonic.fluid.json.readFromMapByElementValue
-import com.github.fluidsonic.fluid.json.readIntOrNull
-import com.github.fluidsonic.fluid.json.readLongOrNull
-import com.github.fluidsonic.fluid.json.readShortOrNull
-import com.github.fluidsonic.fluid.json.readStringOrNull
-import com.github.fluidsonic.fluid.json.readValueOfType
-import com.github.fluidsonic.fluid.json.readValueOfTypeOrNull
-import com.github.fluidsonic.fluid.json.writeBooleanOrNull
-import com.github.fluidsonic.fluid.json.writeByteOrNull
-import com.github.fluidsonic.fluid.json.writeCharOrNull
-import com.github.fluidsonic.fluid.json.writeDoubleOrNull
-import com.github.fluidsonic.fluid.json.writeFloatOrNull
-import com.github.fluidsonic.fluid.json.writeIntOrNull
-import com.github.fluidsonic.fluid.json.writeIntoMap
-import com.github.fluidsonic.fluid.json.writeLongOrNull
-import com.github.fluidsonic.fluid.json.writeMapElement
-import com.github.fluidsonic.fluid.json.writeShortOrNull
-import com.github.fluidsonic.fluid.json.writeStringOrNull
-import com.github.fluidsonic.fluid.json.writeValueOrNull
-import kotlin.String
-
-internal object DefaultRootJSONCodec : AbstractJSONCodec() {
- override fun JSONDecoder.decode(valueType: JSONCodingType):
- DefaultRoot {
- var _value: String? = null
-
- readFromMapByElementValue { key ->
- when (key) {
- "value" -> _value = readString()
- else -> skipValue()
- }
- }
-
- return DefaultRoot(
- value = _value ?: missingPropertyError("value")
- )
- }
-
- override fun JSONEncoder.encode(value: DefaultRoot) {
- writeIntoMap {
- writeMapElement("value", string = value.value)
- }
- }
-}
diff --git a/annotation-processor/tests/cases/1/output-expected/DefaultRootJsonCodec.kt b/annotation-processor/tests/cases/1/output-expected/DefaultRootJsonCodec.kt
new file mode 100644
index 0000000..a631702
--- /dev/null
+++ b/annotation-processor/tests/cases/1/output-expected/DefaultRootJsonCodec.kt
@@ -0,0 +1,55 @@
+import codecProvider.CustomCodingContext
+import io.fluidsonic.json.AbstractJsonCodec
+import io.fluidsonic.json.JsonCodingType
+import io.fluidsonic.json.JsonDecoder
+import io.fluidsonic.json.JsonEncoder
+import io.fluidsonic.json.missingPropertyError
+import io.fluidsonic.json.readBooleanOrNull
+import io.fluidsonic.json.readByteOrNull
+import io.fluidsonic.json.readCharOrNull
+import io.fluidsonic.json.readDoubleOrNull
+import io.fluidsonic.json.readFloatOrNull
+import io.fluidsonic.json.readFromMapByElementValue
+import io.fluidsonic.json.readIntOrNull
+import io.fluidsonic.json.readLongOrNull
+import io.fluidsonic.json.readShortOrNull
+import io.fluidsonic.json.readStringOrNull
+import io.fluidsonic.json.readValueOfType
+import io.fluidsonic.json.readValueOfTypeOrNull
+import io.fluidsonic.json.writeBooleanOrNull
+import io.fluidsonic.json.writeByteOrNull
+import io.fluidsonic.json.writeCharOrNull
+import io.fluidsonic.json.writeDoubleOrNull
+import io.fluidsonic.json.writeFloatOrNull
+import io.fluidsonic.json.writeIntOrNull
+import io.fluidsonic.json.writeIntoMap
+import io.fluidsonic.json.writeLongOrNull
+import io.fluidsonic.json.writeMapElement
+import io.fluidsonic.json.writeShortOrNull
+import io.fluidsonic.json.writeStringOrNull
+import io.fluidsonic.json.writeValueOrNull
+import kotlin.String
+
+internal object DefaultRootJsonCodec : AbstractJsonCodec() {
+ override fun JsonDecoder.decode(valueType: JsonCodingType):
+ DefaultRoot {
+ var _value: String? = null
+
+ readFromMapByElementValue { key ->
+ when (key) {
+ "value" -> _value = readString()
+ else -> skipValue()
+ }
+ }
+
+ return DefaultRoot(
+ value = _value ?: missingPropertyError("value")
+ )
+ }
+
+ override fun JsonEncoder.encode(value: DefaultRoot) {
+ writeIntoMap {
+ writeMapElement("value", string = value.value)
+ }
+ }
+}
diff --git a/annotation-processor/tests/cases/1/output-expected/codecProvider/GeneratedCustomContextCodecProvider.kt b/annotation-processor/tests/cases/1/output-expected/codecProvider/GeneratedCustomContextCodecProvider.kt
index caedab3..3889d28 100644
--- a/annotation-processor/tests/cases/1/output-expected/codecProvider/GeneratedCustomContextCodecProvider.kt
+++ b/annotation-processor/tests/cases/1/output-expected/codecProvider/GeneratedCustomContextCodecProvider.kt
@@ -1,50 +1,50 @@
package codecProvider
-import AutomaticRootJSONCodec
-import CustomRootJSONCodec
-import DefaultRootJSONCodec
-import com.github.fluidsonic.fluid.json.JSONCodecProvider
+import AutomaticRootJsonCodec
+import CustomRootJsonCodec
+import DefaultRootJsonCodec
+import io.fluidsonic.json.JsonCodecProvider
import kotlin.Suppress
import kotlin.reflect.KClass
private object GeneratedCustomContextCodecProvider : CustomContextCodecProvider,
- JSONCodecProvider by JSONCodecProvider(AutomaticRootJSONCodec,
- CustomRootJSONCodec, DefaultRootJSONCodec, customProperties.CustomContextJSONCodec,
- customProperties.DifferentPackageJSONCodec, customProperties.SamePackageJSONCodec,
- externalType.ExternalPairCodec, externalType.KT30280JSONCodec,
- externalType.KT30280PrimitiveJSONCodec, json.classes.ClassJSONCodec,
- json.classes.DataClassJSONCodec, json.classes.GenericClassJSONCodec,
- json.classes.InlineClassJSONCodec, json.classes.ObjectJSONCodec,
- json.codecName.AutomaticJSONCodec, json.codecName.CustomizedJSONCodec,
- json.codecName.DefaultJSONCodec, json.codecPackageName.AutomaticJSONCodec,
- json.codecPackageName.DefaultJSONCodec, json.codecPackageName.customized.CustomJSONCodec,
- json.codecVisibility.AutomaticInternalForContainedClass_ContainedClassJSONCodec,
- json.codecVisibility.AutomaticInternalJSONCodec, json.codecVisibility.AutomaticPublicJSONCodec,
- json.codecVisibility.DefaultInternalJSONCodec, json.codecVisibility.InternalJSONCodec,
- json.codecVisibility.PublicJSONCodec, json.decoding.AnnotatedConstructorJSONCodec,
- json.decoding.AutomaticAnnotatedConstructorJSONCodec, json.decoding.AutomaticObjectJSONCodec,
- json.decoding.AutomaticPrimaryConstructorJSONCodec,
- json.decoding.AutomaticSecondaryConstructorPrimaryExcludedJSONCodec,
- json.decoding.AutomaticSecondaryConstructorPrimaryInaccessibleJSONCodec,
- json.decoding.AutomaticSecondaryConstructorPrimaryNotPresentJSONCodec,
- json.decoding.ConstructorParameterOrderJSONCodec,
- json.decoding.DefaultAnnotatedConstructorJSONCodec, json.decoding.DefaultObjectJSONCodec,
- json.decoding.DefaultPrimaryConstructorJSONCodec,
- json.decoding.DefaultSecondaryConstructorPrimaryExcludedJSONCodec,
- json.decoding.DefaultSecondaryConstructorPrimaryInaccessibleJSONCodec,
- json.decoding.DefaultSecondaryConstructorPrimaryNotPresentJSONCodec, json.decoding.NoneJSONCodec,
- json.decoding.PrimaryConstructorJSONCodec, json.encoding.AllPropertiesJSONCodec,
- json.encoding.AnnotatedPropertiesJSONCodec, json.encoding.AutomaticJSONCodec,
- json.encoding.DefaultJSONCodec, json.encoding.NoneJSONCodec,
- json.representation.AutomaticSingleValueJSONCodec,
- json.representation.AutomaticStructuredJSONCodec, json.representation.DefaultSingleValueJSONCodec,
- json.representation.DefaultStructuredJSONCodec, json.representation.SingleValueGenericJSONCodec,
- json.representation.SingleValueJSONCodec, json.representation.SingleValueNullableJSONCodec,
- json.representation.StructuredJSONCodec, json.representation.StructuredValueGenericJSONCodec,
- property.defaultValue.AutomaticGenericJSONCodec, property.defaultValue.AutomaticJSONCodec,
- property.serializedName.AutomaticJSONCodec, property.serializedName.CustomJSONCodec,
- property.serializedName.DefaultJSONCodec)
+ JsonCodecProvider by JsonCodecProvider(AutomaticRootJsonCodec,
+ CustomRootJsonCodec, DefaultRootJsonCodec, customProperties.CustomContextJsonCodec,
+ customProperties.DifferentPackageJsonCodec, customProperties.SamePackageJsonCodec,
+ externalType.ExternalPairCodec, externalType.KT30280JsonCodec,
+ externalType.KT30280PrimitiveJsonCodec, json.classes.ClassJsonCodec,
+ json.classes.DataClassJsonCodec, json.classes.GenericClassJsonCodec,
+ json.classes.InlineClassJsonCodec, json.classes.ObjectJsonCodec,
+ json.codecName.AutomaticJsonCodec, json.codecName.CustomizedJsonCodec,
+ json.codecName.DefaultJsonCodec, json.codecPackageName.AutomaticJsonCodec,
+ json.codecPackageName.DefaultJsonCodec, json.codecPackageName.customized.CustomJsonCodec,
+ json.codecVisibility.AutomaticInternalForContainedClass_ContainedClassJsonCodec,
+ json.codecVisibility.AutomaticInternalJsonCodec, json.codecVisibility.AutomaticPublicJsonCodec,
+ json.codecVisibility.DefaultInternalJsonCodec, json.codecVisibility.InternalJsonCodec,
+ json.codecVisibility.PublicJsonCodec, json.decoding.AnnotatedConstructorJsonCodec,
+ json.decoding.AutomaticAnnotatedConstructorJsonCodec, json.decoding.AutomaticObjectJsonCodec,
+ json.decoding.AutomaticPrimaryConstructorJsonCodec,
+ json.decoding.AutomaticSecondaryConstructorPrimaryExcludedJsonCodec,
+ json.decoding.AutomaticSecondaryConstructorPrimaryInaccessibleJsonCodec,
+ json.decoding.AutomaticSecondaryConstructorPrimaryNotPresentJsonCodec,
+ json.decoding.ConstructorParameterOrderJsonCodec,
+ json.decoding.DefaultAnnotatedConstructorJsonCodec, json.decoding.DefaultObjectJsonCodec,
+ json.decoding.DefaultPrimaryConstructorJsonCodec,
+ json.decoding.DefaultSecondaryConstructorPrimaryExcludedJsonCodec,
+ json.decoding.DefaultSecondaryConstructorPrimaryInaccessibleJsonCodec,
+ json.decoding.DefaultSecondaryConstructorPrimaryNotPresentJsonCodec, json.decoding.NoneJsonCodec,
+ json.decoding.PrimaryConstructorJsonCodec, json.encoding.AllPropertiesJsonCodec,
+ json.encoding.AnnotatedPropertiesJsonCodec, json.encoding.AutomaticJsonCodec,
+ json.encoding.DefaultJsonCodec, json.encoding.NoneJsonCodec,
+ json.representation.AutomaticSingleValueJsonCodec,
+ json.representation.AutomaticStructuredJsonCodec, json.representation.DefaultSingleValueJsonCodec,
+ json.representation.DefaultStructuredJsonCodec, json.representation.SingleValueGenericJsonCodec,
+ json.representation.SingleValueJsonCodec, json.representation.SingleValueNullableJsonCodec,
+ json.representation.StructuredJsonCodec, json.representation.StructuredValueGenericJsonCodec,
+ property.defaultValue.AutomaticGenericJsonCodec, property.defaultValue.AutomaticJsonCodec,
+ property.serializedName.AutomaticJsonCodec, property.serializedName.CustomJsonCodec,
+ property.serializedName.DefaultJsonCodec)
@Suppress("UNUSED_PARAMETER")
-fun JSONCodecProvider.Companion.generated(interfaceClass: KClass):
+fun JsonCodecProvider.Companion.generated(interfaceClass: KClass):
CustomContextCodecProvider = GeneratedCustomContextCodecProvider
diff --git a/annotation-processor/tests/cases/1/output-expected/customProperties/CustomContextJSONCodec.kt b/annotation-processor/tests/cases/1/output-expected/customProperties/CustomContextJSONCodec.kt
deleted file mode 100644
index e387697..0000000
--- a/annotation-processor/tests/cases/1/output-expected/customProperties/CustomContextJSONCodec.kt
+++ /dev/null
@@ -1,60 +0,0 @@
-package customProperties
-
-import codecProvider.CustomCodingContext
-import com.github.fluidsonic.fluid.json.AbstractJSONCodec
-import com.github.fluidsonic.fluid.json.JSONCodingType
-import com.github.fluidsonic.fluid.json.JSONDecoder
-import com.github.fluidsonic.fluid.json.JSONEncoder
-import com.github.fluidsonic.fluid.json.missingPropertyError
-import com.github.fluidsonic.fluid.json.readBooleanOrNull
-import com.github.fluidsonic.fluid.json.readByteOrNull
-import com.github.fluidsonic.fluid.json.readCharOrNull
-import com.github.fluidsonic.fluid.json.readDoubleOrNull
-import com.github.fluidsonic.fluid.json.readFloatOrNull
-import com.github.fluidsonic.fluid.json.readFromMapByElementValue
-import com.github.fluidsonic.fluid.json.readIntOrNull
-import com.github.fluidsonic.fluid.json.readLongOrNull
-import com.github.fluidsonic.fluid.json.readShortOrNull
-import com.github.fluidsonic.fluid.json.readStringOrNull
-import com.github.fluidsonic.fluid.json.readValueOfType
-import com.github.fluidsonic.fluid.json.readValueOfTypeOrNull
-import com.github.fluidsonic.fluid.json.writeBooleanOrNull
-import com.github.fluidsonic.fluid.json.writeByteOrNull
-import com.github.fluidsonic.fluid.json.writeCharOrNull
-import com.github.fluidsonic.fluid.json.writeDoubleOrNull
-import com.github.fluidsonic.fluid.json.writeFloatOrNull
-import com.github.fluidsonic.fluid.json.writeIntOrNull
-import com.github.fluidsonic.fluid.json.writeIntoMap
-import com.github.fluidsonic.fluid.json.writeLongOrNull
-import com.github.fluidsonic.fluid.json.writeMapElement
-import com.github.fluidsonic.fluid.json.writeShortOrNull
-import com.github.fluidsonic.fluid.json.writeStringOrNull
-import com.github.fluidsonic.fluid.json.writeValueOrNull
-import customProperties.writeCustomProperties2
-import kotlin.String
-
-internal object CustomContextJSONCodec : AbstractJSONCodec() {
- override fun JSONDecoder.decode(valueType: JSONCodingType):
- CustomContext {
- var _value: String? = null
-
- readFromMapByElementValue { key ->
- when (key) {
- "value" -> _value = readString()
- else -> skipValue()
- }
- }
-
- return CustomContext(
- value = _value ?: missingPropertyError("value")
- )
- }
-
- override fun JSONEncoder.encode(value: CustomContext) {
- writeIntoMap {
- writeMapElement("value", string = value.value)
- value.run { this@encode.writeCustomProperties1() }
- writeCustomProperties2(value)
- }
- }
-}
diff --git a/annotation-processor/tests/cases/1/output-expected/customProperties/CustomContextJsonCodec.kt b/annotation-processor/tests/cases/1/output-expected/customProperties/CustomContextJsonCodec.kt
new file mode 100644
index 0000000..7405916
--- /dev/null
+++ b/annotation-processor/tests/cases/1/output-expected/customProperties/CustomContextJsonCodec.kt
@@ -0,0 +1,60 @@
+package customProperties
+
+import codecProvider.CustomCodingContext
+import customProperties.writeCustomProperties2
+import io.fluidsonic.json.AbstractJsonCodec
+import io.fluidsonic.json.JsonCodingType
+import io.fluidsonic.json.JsonDecoder
+import io.fluidsonic.json.JsonEncoder
+import io.fluidsonic.json.missingPropertyError
+import io.fluidsonic.json.readBooleanOrNull
+import io.fluidsonic.json.readByteOrNull
+import io.fluidsonic.json.readCharOrNull
+import io.fluidsonic.json.readDoubleOrNull
+import io.fluidsonic.json.readFloatOrNull
+import io.fluidsonic.json.readFromMapByElementValue
+import io.fluidsonic.json.readIntOrNull
+import io.fluidsonic.json.readLongOrNull
+import io.fluidsonic.json.readShortOrNull
+import io.fluidsonic.json.readStringOrNull
+import io.fluidsonic.json.readValueOfType
+import io.fluidsonic.json.readValueOfTypeOrNull
+import io.fluidsonic.json.writeBooleanOrNull
+import io.fluidsonic.json.writeByteOrNull
+import io.fluidsonic.json.writeCharOrNull
+import io.fluidsonic.json.writeDoubleOrNull
+import io.fluidsonic.json.writeFloatOrNull
+import io.fluidsonic.json.writeIntOrNull
+import io.fluidsonic.json.writeIntoMap
+import io.fluidsonic.json.writeLongOrNull
+import io.fluidsonic.json.writeMapElement
+import io.fluidsonic.json.writeShortOrNull
+import io.fluidsonic.json.writeStringOrNull
+import io.fluidsonic.json.writeValueOrNull
+import kotlin.String
+
+internal object CustomContextJsonCodec : AbstractJsonCodec() {
+ override fun JsonDecoder.decode(valueType: JsonCodingType):
+ CustomContext {
+ var _value: String? = null
+
+ readFromMapByElementValue { key ->
+ when (key) {
+ "value" -> _value = readString()
+ else -> skipValue()
+ }
+ }
+
+ return CustomContext(
+ value = _value ?: missingPropertyError("value")
+ )
+ }
+
+ override fun JsonEncoder.encode(value: CustomContext) {
+ writeIntoMap {
+ writeMapElement("value", string = value.value)
+ value.run { this@encode.writeCustomProperties1() }
+ writeCustomProperties2(value)
+ }
+ }
+}
diff --git a/annotation-processor/tests/cases/1/output-expected/customProperties/DifferentPackageJSONCodec.kt b/annotation-processor/tests/cases/1/output-expected/customProperties/DifferentPackageJSONCodec.kt
deleted file mode 100644
index b541f9a..0000000
--- a/annotation-processor/tests/cases/1/output-expected/customProperties/DifferentPackageJSONCodec.kt
+++ /dev/null
@@ -1,63 +0,0 @@
-package customProperties
-
-import codecProvider.CustomCodingContext
-import com.github.fluidsonic.fluid.json.AbstractJSONCodec
-import com.github.fluidsonic.fluid.json.JSONCodingType
-import com.github.fluidsonic.fluid.json.JSONDecoder
-import com.github.fluidsonic.fluid.json.JSONEncoder
-import com.github.fluidsonic.fluid.json.missingPropertyError
-import com.github.fluidsonic.fluid.json.readBooleanOrNull
-import com.github.fluidsonic.fluid.json.readByteOrNull
-import com.github.fluidsonic.fluid.json.readCharOrNull
-import com.github.fluidsonic.fluid.json.readDoubleOrNull
-import com.github.fluidsonic.fluid.json.readFloatOrNull
-import com.github.fluidsonic.fluid.json.readFromMapByElementValue
-import com.github.fluidsonic.fluid.json.readIntOrNull
-import com.github.fluidsonic.fluid.json.readLongOrNull
-import com.github.fluidsonic.fluid.json.readShortOrNull
-import com.github.fluidsonic.fluid.json.readStringOrNull
-import com.github.fluidsonic.fluid.json.readValueOfType
-import com.github.fluidsonic.fluid.json.readValueOfTypeOrNull
-import com.github.fluidsonic.fluid.json.writeBooleanOrNull
-import com.github.fluidsonic.fluid.json.writeByteOrNull
-import com.github.fluidsonic.fluid.json.writeCharOrNull
-import com.github.fluidsonic.fluid.json.writeDoubleOrNull
-import com.github.fluidsonic.fluid.json.writeFloatOrNull
-import com.github.fluidsonic.fluid.json.writeIntOrNull
-import com.github.fluidsonic.fluid.json.writeIntoMap
-import com.github.fluidsonic.fluid.json.writeLongOrNull
-import com.github.fluidsonic.fluid.json.writeMapElement
-import com.github.fluidsonic.fluid.json.writeShortOrNull
-import com.github.fluidsonic.fluid.json.writeStringOrNull
-import com.github.fluidsonic.fluid.json.writeValueOrNull
-import customProperties.differentPackage.writeCustomProperties3
-import customProperties.writeCustomProperties2
-import kotlin.String
-
-internal object DifferentPackageJSONCodec : AbstractJSONCodec() {
- override fun JSONDecoder.decode(valueType: JSONCodingType):
- DifferentPackage {
- var _value: String? = null
-
- readFromMapByElementValue { key ->
- when (key) {
- "value" -> _value = readString()
- else -> skipValue()
- }
- }
-
- return DifferentPackage(
- value = _value ?: missingPropertyError("value")
- )
- }
-
- override fun JSONEncoder.encode(value: DifferentPackage) {
- writeIntoMap {
- writeMapElement("value", string = value.value)
- value.run { this@encode.writeCustomProperties1() }
- writeCustomProperties2(value)
- writeCustomProperties3(value)
- }
- }
-}
diff --git a/annotation-processor/tests/cases/1/output-expected/customProperties/DifferentPackageJsonCodec.kt b/annotation-processor/tests/cases/1/output-expected/customProperties/DifferentPackageJsonCodec.kt
new file mode 100644
index 0000000..0afa4d2
--- /dev/null
+++ b/annotation-processor/tests/cases/1/output-expected/customProperties/DifferentPackageJsonCodec.kt
@@ -0,0 +1,63 @@
+package customProperties
+
+import codecProvider.CustomCodingContext
+import customProperties.differentPackage.writeCustomProperties3
+import customProperties.writeCustomProperties2
+import io.fluidsonic.json.AbstractJsonCodec
+import io.fluidsonic.json.JsonCodingType
+import io.fluidsonic.json.JsonDecoder
+import io.fluidsonic.json.JsonEncoder
+import io.fluidsonic.json.missingPropertyError
+import io.fluidsonic.json.readBooleanOrNull
+import io.fluidsonic.json.readByteOrNull
+import io.fluidsonic.json.readCharOrNull
+import io.fluidsonic.json.readDoubleOrNull
+import io.fluidsonic.json.readFloatOrNull
+import io.fluidsonic.json.readFromMapByElementValue
+import io.fluidsonic.json.readIntOrNull
+import io.fluidsonic.json.readLongOrNull
+import io.fluidsonic.json.readShortOrNull
+import io.fluidsonic.json.readStringOrNull
+import io.fluidsonic.json.readValueOfType
+import io.fluidsonic.json.readValueOfTypeOrNull
+import io.fluidsonic.json.writeBooleanOrNull
+import io.fluidsonic.json.writeByteOrNull
+import io.fluidsonic.json.writeCharOrNull
+import io.fluidsonic.json.writeDoubleOrNull
+import io.fluidsonic.json.writeFloatOrNull
+import io.fluidsonic.json.writeIntOrNull
+import io.fluidsonic.json.writeIntoMap
+import io.fluidsonic.json.writeLongOrNull
+import io.fluidsonic.json.writeMapElement
+import io.fluidsonic.json.writeShortOrNull
+import io.fluidsonic.json.writeStringOrNull
+import io.fluidsonic.json.writeValueOrNull
+import kotlin.String
+
+internal object DifferentPackageJsonCodec : AbstractJsonCodec() {
+ override fun JsonDecoder.decode(valueType: JsonCodingType):
+ DifferentPackage {
+ var _value: String? = null
+
+ readFromMapByElementValue { key ->
+ when (key) {
+ "value" -> _value = readString()
+ else -> skipValue()
+ }
+ }
+
+ return DifferentPackage(
+ value = _value ?: missingPropertyError("value")
+ )
+ }
+
+ override fun JsonEncoder.encode(value: DifferentPackage) {
+ writeIntoMap {
+ writeMapElement("value", string = value.value)
+ value.run { this@encode.writeCustomProperties1() }
+ writeCustomProperties2(value)
+ writeCustomProperties3(value)
+ }
+ }
+}
diff --git a/annotation-processor/tests/cases/1/output-expected/customProperties/SamePackageJSONCodec.kt b/annotation-processor/tests/cases/1/output-expected/customProperties/SamePackageJSONCodec.kt
deleted file mode 100644
index e532494..0000000
--- a/annotation-processor/tests/cases/1/output-expected/customProperties/SamePackageJSONCodec.kt
+++ /dev/null
@@ -1,60 +0,0 @@
-package customProperties
-
-import codecProvider.CustomCodingContext
-import com.github.fluidsonic.fluid.json.AbstractJSONCodec
-import com.github.fluidsonic.fluid.json.JSONCodingType
-import com.github.fluidsonic.fluid.json.JSONDecoder
-import com.github.fluidsonic.fluid.json.JSONEncoder
-import com.github.fluidsonic.fluid.json.missingPropertyError
-import com.github.fluidsonic.fluid.json.readBooleanOrNull
-import com.github.fluidsonic.fluid.json.readByteOrNull
-import com.github.fluidsonic.fluid.json.readCharOrNull
-import com.github.fluidsonic.fluid.json.readDoubleOrNull
-import com.github.fluidsonic.fluid.json.readFloatOrNull
-import com.github.fluidsonic.fluid.json.readFromMapByElementValue
-import com.github.fluidsonic.fluid.json.readIntOrNull
-import com.github.fluidsonic.fluid.json.readLongOrNull
-import com.github.fluidsonic.fluid.json.readShortOrNull
-import com.github.fluidsonic.fluid.json.readStringOrNull
-import com.github.fluidsonic.fluid.json.readValueOfType
-import com.github.fluidsonic.fluid.json.readValueOfTypeOrNull
-import com.github.fluidsonic.fluid.json.writeBooleanOrNull
-import com.github.fluidsonic.fluid.json.writeByteOrNull
-import com.github.fluidsonic.fluid.json.writeCharOrNull
-import com.github.fluidsonic.fluid.json.writeDoubleOrNull
-import com.github.fluidsonic.fluid.json.writeFloatOrNull
-import com.github.fluidsonic.fluid.json.writeIntOrNull
-import com.github.fluidsonic.fluid.json.writeIntoMap
-import com.github.fluidsonic.fluid.json.writeLongOrNull
-import com.github.fluidsonic.fluid.json.writeMapElement
-import com.github.fluidsonic.fluid.json.writeShortOrNull
-import com.github.fluidsonic.fluid.json.writeStringOrNull
-import com.github.fluidsonic.fluid.json.writeValueOrNull
-import customProperties.writeCustomProperties2
-import kotlin.String
-
-internal object SamePackageJSONCodec : AbstractJSONCodec() {
- override fun JSONDecoder.decode(valueType: JSONCodingType):
- SamePackage {
- var _value: String? = null
-
- readFromMapByElementValue { key ->
- when (key) {
- "value" -> _value = readString()
- else -> skipValue()
- }
- }
-
- return SamePackage(
- value = _value ?: missingPropertyError("value")
- )
- }
-
- override fun JSONEncoder.encode(value: SamePackage) {
- writeIntoMap {
- writeMapElement("value", string = value.value)
- value.run { this@encode.writeCustomProperties1() }
- writeCustomProperties2(value)
- }
- }
-}
diff --git a/annotation-processor/tests/cases/1/output-expected/customProperties/SamePackageJsonCodec.kt b/annotation-processor/tests/cases/1/output-expected/customProperties/SamePackageJsonCodec.kt
new file mode 100644
index 0000000..717d2cb
--- /dev/null
+++ b/annotation-processor/tests/cases/1/output-expected/customProperties/SamePackageJsonCodec.kt
@@ -0,0 +1,60 @@
+package customProperties
+
+import codecProvider.CustomCodingContext
+import customProperties.writeCustomProperties2
+import io.fluidsonic.json.AbstractJsonCodec
+import io.fluidsonic.json.JsonCodingType
+import io.fluidsonic.json.JsonDecoder
+import io.fluidsonic.json.JsonEncoder
+import io.fluidsonic.json.missingPropertyError
+import io.fluidsonic.json.readBooleanOrNull
+import io.fluidsonic.json.readByteOrNull
+import io.fluidsonic.json.readCharOrNull
+import io.fluidsonic.json.readDoubleOrNull
+import io.fluidsonic.json.readFloatOrNull
+import io.fluidsonic.json.readFromMapByElementValue
+import io.fluidsonic.json.readIntOrNull
+import io.fluidsonic.json.readLongOrNull
+import io.fluidsonic.json.readShortOrNull
+import io.fluidsonic.json.readStringOrNull
+import io.fluidsonic.json.readValueOfType
+import io.fluidsonic.json.readValueOfTypeOrNull
+import io.fluidsonic.json.writeBooleanOrNull
+import io.fluidsonic.json.writeByteOrNull
+import io.fluidsonic.json.writeCharOrNull
+import io.fluidsonic.json.writeDoubleOrNull
+import io.fluidsonic.json.writeFloatOrNull
+import io.fluidsonic.json.writeIntOrNull
+import io.fluidsonic.json.writeIntoMap
+import io.fluidsonic.json.writeLongOrNull
+import io.fluidsonic.json.writeMapElement
+import io.fluidsonic.json.writeShortOrNull
+import io.fluidsonic.json.writeStringOrNull
+import io.fluidsonic.json.writeValueOrNull
+import kotlin.String
+
+internal object SamePackageJsonCodec : AbstractJsonCodec() {
+ override fun JsonDecoder.decode(valueType: JsonCodingType):
+ SamePackage {
+ var _value: String? = null
+
+ readFromMapByElementValue { key ->
+ when (key) {
+ "value" -> _value = readString()
+ else -> skipValue()
+ }
+ }
+
+ return SamePackage(
+ value = _value ?: missingPropertyError("value")
+ )
+ }
+
+ override fun JsonEncoder.encode(value: SamePackage) {
+ writeIntoMap {
+ writeMapElement("value", string = value.value)
+ value.run { this@encode.writeCustomProperties1() }
+ writeCustomProperties2(value)
+ }
+ }
+}
diff --git a/annotation-processor/tests/cases/1/output-expected/externalType/ExternalPairCodec.kt b/annotation-processor/tests/cases/1/output-expected/externalType/ExternalPairCodec.kt
index e0f8ac4..c1e27f5 100644
--- a/annotation-processor/tests/cases/1/output-expected/externalType/ExternalPairCodec.kt
+++ b/annotation-processor/tests/cases/1/output-expected/externalType/ExternalPairCodec.kt
@@ -1,40 +1,40 @@
package externalType
import codecProvider.CustomCodingContext
-import com.github.fluidsonic.fluid.json.AbstractJSONCodec
-import com.github.fluidsonic.fluid.json.JSONCodingType
-import com.github.fluidsonic.fluid.json.JSONDecoder
-import com.github.fluidsonic.fluid.json.JSONEncoder
-import com.github.fluidsonic.fluid.json.missingPropertyError
-import com.github.fluidsonic.fluid.json.readBooleanOrNull
-import com.github.fluidsonic.fluid.json.readByteOrNull
-import com.github.fluidsonic.fluid.json.readCharOrNull
-import com.github.fluidsonic.fluid.json.readDoubleOrNull
-import com.github.fluidsonic.fluid.json.readFloatOrNull
-import com.github.fluidsonic.fluid.json.readFromMapByElementValue
-import com.github.fluidsonic.fluid.json.readIntOrNull
-import com.github.fluidsonic.fluid.json.readLongOrNull
-import com.github.fluidsonic.fluid.json.readShortOrNull
-import com.github.fluidsonic.fluid.json.readStringOrNull
-import com.github.fluidsonic.fluid.json.readValueOfType
-import com.github.fluidsonic.fluid.json.readValueOfTypeOrNull
-import com.github.fluidsonic.fluid.json.writeBooleanOrNull
-import com.github.fluidsonic.fluid.json.writeByteOrNull
-import com.github.fluidsonic.fluid.json.writeCharOrNull
-import com.github.fluidsonic.fluid.json.writeDoubleOrNull
-import com.github.fluidsonic.fluid.json.writeFloatOrNull
-import com.github.fluidsonic.fluid.json.writeIntOrNull
-import com.github.fluidsonic.fluid.json.writeIntoMap
-import com.github.fluidsonic.fluid.json.writeLongOrNull
-import com.github.fluidsonic.fluid.json.writeMapElement
-import com.github.fluidsonic.fluid.json.writeShortOrNull
-import com.github.fluidsonic.fluid.json.writeStringOrNull
-import com.github.fluidsonic.fluid.json.writeValueOrNull
+import io.fluidsonic.json.AbstractJsonCodec
+import io.fluidsonic.json.JsonCodingType
+import io.fluidsonic.json.JsonDecoder
+import io.fluidsonic.json.JsonEncoder
+import io.fluidsonic.json.missingPropertyError
+import io.fluidsonic.json.readBooleanOrNull
+import io.fluidsonic.json.readByteOrNull
+import io.fluidsonic.json.readCharOrNull
+import io.fluidsonic.json.readDoubleOrNull
+import io.fluidsonic.json.readFloatOrNull
+import io.fluidsonic.json.readFromMapByElementValue
+import io.fluidsonic.json.readIntOrNull
+import io.fluidsonic.json.readLongOrNull
+import io.fluidsonic.json.readShortOrNull
+import io.fluidsonic.json.readStringOrNull
+import io.fluidsonic.json.readValueOfType
+import io.fluidsonic.json.readValueOfTypeOrNull
+import io.fluidsonic.json.writeBooleanOrNull
+import io.fluidsonic.json.writeByteOrNull
+import io.fluidsonic.json.writeCharOrNull
+import io.fluidsonic.json.writeDoubleOrNull
+import io.fluidsonic.json.writeFloatOrNull
+import io.fluidsonic.json.writeIntOrNull
+import io.fluidsonic.json.writeIntoMap
+import io.fluidsonic.json.writeLongOrNull
+import io.fluidsonic.json.writeMapElement
+import io.fluidsonic.json.writeShortOrNull
+import io.fluidsonic.json.writeStringOrNull
+import io.fluidsonic.json.writeValueOrNull
import kotlin.Any
import kotlin.Pair
-object ExternalPairCodec : AbstractJSONCodec, CustomCodingContext>() {
- override fun JSONDecoder.decode(valueType: JSONCodingType>):
+object ExternalPairCodec : AbstractJsonCodec, CustomCodingContext>() {
+ override fun JsonDecoder.decode(valueType: JsonCodingType>):
Pair<*, *> {
var _first: Any? = null
var _second: Any? = null
@@ -53,7 +53,7 @@ object ExternalPairCodec : AbstractJSONCodec, CustomCodingContext>()
)
}
- override fun JSONEncoder.encode(value: Pair<*, *>) {
+ override fun JsonEncoder.encode(value: Pair<*, *>) {
writeIntoMap {
writeMapElement("first", value = value.first)
writeMapElement("second", value = value.second)
diff --git a/annotation-processor/tests/cases/1/output-expected/externalType/KT30280JSONCodec.kt b/annotation-processor/tests/cases/1/output-expected/externalType/KT30280JSONCodec.kt
deleted file mode 100644
index 2d0369d..0000000
--- a/annotation-processor/tests/cases/1/output-expected/externalType/KT30280JSONCodec.kt
+++ /dev/null
@@ -1,28 +0,0 @@
-package externalType
-
-import codecProvider.CustomCodingContext
-import codecProvider.KT30280
-import com.github.fluidsonic.fluid.json.AbstractJSONCodec
-import com.github.fluidsonic.fluid.json.JSONCodingType
-import com.github.fluidsonic.fluid.json.JSONDecoder
-import com.github.fluidsonic.fluid.json.JSONEncoder
-import com.github.fluidsonic.fluid.json.readBooleanOrNull
-import com.github.fluidsonic.fluid.json.readByteOrNull
-import com.github.fluidsonic.fluid.json.readCharOrNull
-import com.github.fluidsonic.fluid.json.readDoubleOrNull
-import com.github.fluidsonic.fluid.json.readFloatOrNull
-import com.github.fluidsonic.fluid.json.readIntOrNull
-import com.github.fluidsonic.fluid.json.readLongOrNull
-import com.github.fluidsonic.fluid.json.readShortOrNull
-import com.github.fluidsonic.fluid.json.readStringOrNull
-import com.github.fluidsonic.fluid.json.readValueOfType
-import com.github.fluidsonic.fluid.json.readValueOfTypeOrNull
-import com.github.fluidsonic.fluid.json.writeValueOrNull
-
-internal object KT30280JSONCodec : AbstractJSONCodec() {
- override fun JSONDecoder.decode(valueType: JSONCodingType): KT30280 =
- KT30280(value = readString())
- override fun JSONEncoder.encode(value: KT30280) {
- writeString(value.value)
- }
-}
diff --git a/annotation-processor/tests/cases/1/output-expected/externalType/KT30280JsonCodec.kt b/annotation-processor/tests/cases/1/output-expected/externalType/KT30280JsonCodec.kt
new file mode 100644
index 0000000..3bb2eaf
--- /dev/null
+++ b/annotation-processor/tests/cases/1/output-expected/externalType/KT30280JsonCodec.kt
@@ -0,0 +1,28 @@
+package externalType
+
+import codecProvider.CustomCodingContext
+import codecProvider.KT30280
+import io.fluidsonic.json.AbstractJsonCodec
+import io.fluidsonic.json.JsonCodingType
+import io.fluidsonic.json.JsonDecoder
+import io.fluidsonic.json.JsonEncoder
+import io.fluidsonic.json.readBooleanOrNull
+import io.fluidsonic.json.readByteOrNull
+import io.fluidsonic.json.readCharOrNull
+import io.fluidsonic.json.readDoubleOrNull
+import io.fluidsonic.json.readFloatOrNull
+import io.fluidsonic.json.readIntOrNull
+import io.fluidsonic.json.readLongOrNull
+import io.fluidsonic.json.readShortOrNull
+import io.fluidsonic.json.readStringOrNull
+import io.fluidsonic.json.readValueOfType
+import io.fluidsonic.json.readValueOfTypeOrNull
+import io.fluidsonic.json.writeValueOrNull
+
+internal object KT30280JsonCodec : AbstractJsonCodec() {
+ override fun JsonDecoder.decode(valueType: JsonCodingType): KT30280 =
+ KT30280(value = readString())
+ override fun JsonEncoder.encode(value: KT30280) {
+ writeString(value.value)
+ }
+}
diff --git a/annotation-processor/tests/cases/1/output-expected/externalType/KT30280PrimitiveJSONCodec.kt b/annotation-processor/tests/cases/1/output-expected/externalType/KT30280PrimitiveJSONCodec.kt
deleted file mode 100644
index e2d9b49..0000000
--- a/annotation-processor/tests/cases/1/output-expected/externalType/KT30280PrimitiveJSONCodec.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-package externalType
-
-import codecProvider.CustomCodingContext
-import codecProvider.KT30280Primitive
-import com.github.fluidsonic.fluid.json.AbstractJSONCodec
-import com.github.fluidsonic.fluid.json.JSONCodingType
-import com.github.fluidsonic.fluid.json.JSONDecoder
-import com.github.fluidsonic.fluid.json.JSONEncoder
-import com.github.fluidsonic.fluid.json.readBooleanOrNull
-import com.github.fluidsonic.fluid.json.readByteOrNull
-import com.github.fluidsonic.fluid.json.readCharOrNull
-import com.github.fluidsonic.fluid.json.readDoubleOrNull
-import com.github.fluidsonic.fluid.json.readFloatOrNull
-import com.github.fluidsonic.fluid.json.readIntOrNull
-import com.github.fluidsonic.fluid.json.readLongOrNull
-import com.github.fluidsonic.fluid.json.readShortOrNull
-import com.github.fluidsonic.fluid.json.readStringOrNull
-import com.github.fluidsonic.fluid.json.readValueOfType
-import com.github.fluidsonic.fluid.json.readValueOfTypeOrNull
-import com.github.fluidsonic.fluid.json.writeValueOrNull
-
-internal object KT30280PrimitiveJSONCodec : AbstractJSONCodec() {
- override fun JSONDecoder.decode(valueType: JSONCodingType):
- KT30280Primitive = KT30280Primitive(value = readDouble())
- override fun JSONEncoder.encode(value: KT30280Primitive) {
- writeDouble(value.value)
- }
-}
diff --git a/annotation-processor/tests/cases/1/output-expected/externalType/KT30280PrimitiveJsonCodec.kt b/annotation-processor/tests/cases/1/output-expected/externalType/KT30280PrimitiveJsonCodec.kt
new file mode 100644
index 0000000..9645371
--- /dev/null
+++ b/annotation-processor/tests/cases/1/output-expected/externalType/KT30280PrimitiveJsonCodec.kt
@@ -0,0 +1,29 @@
+package externalType
+
+import codecProvider.CustomCodingContext
+import codecProvider.KT30280Primitive
+import io.fluidsonic.json.AbstractJsonCodec
+import io.fluidsonic.json.JsonCodingType
+import io.fluidsonic.json.JsonDecoder
+import io.fluidsonic.json.JsonEncoder
+import io.fluidsonic.json.readBooleanOrNull
+import io.fluidsonic.json.readByteOrNull
+import io.fluidsonic.json.readCharOrNull
+import io.fluidsonic.json.readDoubleOrNull
+import io.fluidsonic.json.readFloatOrNull
+import io.fluidsonic.json.readIntOrNull
+import io.fluidsonic.json.readLongOrNull
+import io.fluidsonic.json.readShortOrNull
+import io.fluidsonic.json.readStringOrNull
+import io.fluidsonic.json.readValueOfType
+import io.fluidsonic.json.readValueOfTypeOrNull
+import io.fluidsonic.json.writeValueOrNull
+
+internal object KT30280PrimitiveJsonCodec : AbstractJsonCodec() {
+ override fun JsonDecoder.decode(valueType: JsonCodingType):
+ KT30280Primitive = KT30280Primitive(value = readDouble())
+ override fun JsonEncoder.encode(value: KT30280Primitive) {
+ writeDouble(value.value)
+ }
+}
diff --git a/annotation-processor/tests/cases/1/output-expected/json/classes/ClassJSONCodec.kt b/annotation-processor/tests/cases/1/output-expected/json/classes/ClassJSONCodec.kt
deleted file mode 100644
index 470bda9..0000000
--- a/annotation-processor/tests/cases/1/output-expected/json/classes/ClassJSONCodec.kt
+++ /dev/null
@@ -1,56 +0,0 @@
-package json.classes
-
-import codecProvider.CustomCodingContext
-import com.github.fluidsonic.fluid.json.AbstractJSONCodec
-import com.github.fluidsonic.fluid.json.JSONCodingType
-import com.github.fluidsonic.fluid.json.JSONDecoder
-import com.github.fluidsonic.fluid.json.JSONEncoder
-import com.github.fluidsonic.fluid.json.missingPropertyError
-import com.github.fluidsonic.fluid.json.readBooleanOrNull
-import com.github.fluidsonic.fluid.json.readByteOrNull
-import com.github.fluidsonic.fluid.json.readCharOrNull
-import com.github.fluidsonic.fluid.json.readDoubleOrNull
-import com.github.fluidsonic.fluid.json.readFloatOrNull
-import com.github.fluidsonic.fluid.json.readFromMapByElementValue
-import com.github.fluidsonic.fluid.json.readIntOrNull
-import com.github.fluidsonic.fluid.json.readLongOrNull
-import com.github.fluidsonic.fluid.json.readShortOrNull
-import com.github.fluidsonic.fluid.json.readStringOrNull
-import com.github.fluidsonic.fluid.json.readValueOfType
-import com.github.fluidsonic.fluid.json.readValueOfTypeOrNull
-import com.github.fluidsonic.fluid.json.writeBooleanOrNull
-import com.github.fluidsonic.fluid.json.writeByteOrNull
-import com.github.fluidsonic.fluid.json.writeCharOrNull
-import com.github.fluidsonic.fluid.json.writeDoubleOrNull
-import com.github.fluidsonic.fluid.json.writeFloatOrNull
-import com.github.fluidsonic.fluid.json.writeIntOrNull
-import com.github.fluidsonic.fluid.json.writeIntoMap
-import com.github.fluidsonic.fluid.json.writeLongOrNull
-import com.github.fluidsonic.fluid.json.writeMapElement
-import com.github.fluidsonic.fluid.json.writeShortOrNull
-import com.github.fluidsonic.fluid.json.writeStringOrNull
-import com.github.fluidsonic.fluid.json.writeValueOrNull
-import kotlin.String
-
-internal object ClassJSONCodec : AbstractJSONCodec() {
- override fun JSONDecoder.decode(valueType: JSONCodingType): Class {
- var _value: String? = null
-
- readFromMapByElementValue { key ->
- when (key) {
- "value" -> _value = readString()
- else -> skipValue()
- }
- }
-
- return Class(
- value = _value ?: missingPropertyError("value")
- )
- }
-
- override fun JSONEncoder.encode(value: Class) {
- writeIntoMap {
- writeMapElement("value", string = value.value)
- }
- }
-}
diff --git a/annotation-processor/tests/cases/1/output-expected/json/classes/ClassJsonCodec.kt b/annotation-processor/tests/cases/1/output-expected/json/classes/ClassJsonCodec.kt
new file mode 100644
index 0000000..27cce0b
--- /dev/null
+++ b/annotation-processor/tests/cases/1/output-expected/json/classes/ClassJsonCodec.kt
@@ -0,0 +1,56 @@
+package json.classes
+
+import codecProvider.CustomCodingContext
+import io.fluidsonic.json.AbstractJsonCodec
+import io.fluidsonic.json.JsonCodingType
+import io.fluidsonic.json.JsonDecoder
+import io.fluidsonic.json.JsonEncoder
+import io.fluidsonic.json.missingPropertyError
+import io.fluidsonic.json.readBooleanOrNull
+import io.fluidsonic.json.readByteOrNull
+import io.fluidsonic.json.readCharOrNull
+import io.fluidsonic.json.readDoubleOrNull
+import io.fluidsonic.json.readFloatOrNull
+import io.fluidsonic.json.readFromMapByElementValue
+import io.fluidsonic.json.readIntOrNull
+import io.fluidsonic.json.readLongOrNull
+import io.fluidsonic.json.readShortOrNull
+import io.fluidsonic.json.readStringOrNull
+import io.fluidsonic.json.readValueOfType
+import io.fluidsonic.json.readValueOfTypeOrNull
+import io.fluidsonic.json.writeBooleanOrNull
+import io.fluidsonic.json.writeByteOrNull
+import io.fluidsonic.json.writeCharOrNull
+import io.fluidsonic.json.writeDoubleOrNull
+import io.fluidsonic.json.writeFloatOrNull
+import io.fluidsonic.json.writeIntOrNull
+import io.fluidsonic.json.writeIntoMap
+import io.fluidsonic.json.writeLongOrNull
+import io.fluidsonic.json.writeMapElement
+import io.fluidsonic.json.writeShortOrNull
+import io.fluidsonic.json.writeStringOrNull
+import io.fluidsonic.json.writeValueOrNull
+import kotlin.String
+
+internal object ClassJsonCodec : AbstractJsonCodec() {
+ override fun JsonDecoder.decode(valueType: JsonCodingType): Class {
+ var _value: String? = null
+
+ readFromMapByElementValue { key ->
+ when (key) {
+ "value" -> _value = readString()
+ else -> skipValue()
+ }
+ }
+
+ return Class(
+ value = _value ?: missingPropertyError("value")
+ )
+ }
+
+ override fun JsonEncoder.encode(value: Class) {
+ writeIntoMap {
+ writeMapElement("value", string = value.value)
+ }
+ }
+}
diff --git a/annotation-processor/tests/cases/1/output-expected/json/classes/DataClassJSONCodec.kt b/annotation-processor/tests/cases/1/output-expected/json/classes/DataClassJSONCodec.kt
deleted file mode 100644
index f77ccf6..0000000
--- a/annotation-processor/tests/cases/1/output-expected/json/classes/DataClassJSONCodec.kt
+++ /dev/null
@@ -1,57 +0,0 @@
-package json.classes
-
-import codecProvider.CustomCodingContext
-import com.github.fluidsonic.fluid.json.AbstractJSONCodec
-import com.github.fluidsonic.fluid.json.JSONCodingType
-import com.github.fluidsonic.fluid.json.JSONDecoder
-import com.github.fluidsonic.fluid.json.JSONEncoder
-import com.github.fluidsonic.fluid.json.missingPropertyError
-import com.github.fluidsonic.fluid.json.readBooleanOrNull
-import com.github.fluidsonic.fluid.json.readByteOrNull
-import com.github.fluidsonic.fluid.json.readCharOrNull
-import com.github.fluidsonic.fluid.json.readDoubleOrNull
-import com.github.fluidsonic.fluid.json.readFloatOrNull
-import com.github.fluidsonic.fluid.json.readFromMapByElementValue
-import com.github.fluidsonic.fluid.json.readIntOrNull
-import com.github.fluidsonic.fluid.json.readLongOrNull
-import com.github.fluidsonic.fluid.json.readShortOrNull
-import com.github.fluidsonic.fluid.json.readStringOrNull
-import com.github.fluidsonic.fluid.json.readValueOfType
-import com.github.fluidsonic.fluid.json.readValueOfTypeOrNull
-import com.github.fluidsonic.fluid.json.writeBooleanOrNull
-import com.github.fluidsonic.fluid.json.writeByteOrNull
-import com.github.fluidsonic.fluid.json.writeCharOrNull
-import com.github.fluidsonic.fluid.json.writeDoubleOrNull
-import com.github.fluidsonic.fluid.json.writeFloatOrNull
-import com.github.fluidsonic.fluid.json.writeIntOrNull
-import com.github.fluidsonic.fluid.json.writeIntoMap
-import com.github.fluidsonic.fluid.json.writeLongOrNull
-import com.github.fluidsonic.fluid.json.writeMapElement
-import com.github.fluidsonic.fluid.json.writeShortOrNull
-import com.github.fluidsonic.fluid.json.writeStringOrNull
-import com.github.fluidsonic.fluid.json.writeValueOrNull
-import kotlin.String
-
-internal object DataClassJSONCodec : AbstractJSONCodec() {
- override fun JSONDecoder.decode(valueType: JSONCodingType):
- DataClass {
- var _value: String? = null
-
- readFromMapByElementValue { key ->
- when (key) {
- "value" -> _value = readString()
- else -> skipValue()
- }
- }
-
- return DataClass(
- value = _value ?: missingPropertyError("value")
- )
- }
-
- override fun JSONEncoder.encode(value: DataClass) {
- writeIntoMap {
- writeMapElement("value", string = value.value)
- }
- }
-}
diff --git a/annotation-processor/tests/cases/1/output-expected/json/classes/DataClassJsonCodec.kt b/annotation-processor/tests/cases/1/output-expected/json/classes/DataClassJsonCodec.kt
new file mode 100644
index 0000000..e28dfef
--- /dev/null
+++ b/annotation-processor/tests/cases/1/output-expected/json/classes/DataClassJsonCodec.kt
@@ -0,0 +1,57 @@
+package json.classes
+
+import codecProvider.CustomCodingContext
+import io.fluidsonic.json.AbstractJsonCodec
+import io.fluidsonic.json.JsonCodingType
+import io.fluidsonic.json.JsonDecoder
+import io.fluidsonic.json.JsonEncoder
+import io.fluidsonic.json.missingPropertyError
+import io.fluidsonic.json.readBooleanOrNull
+import io.fluidsonic.json.readByteOrNull
+import io.fluidsonic.json.readCharOrNull
+import io.fluidsonic.json.readDoubleOrNull
+import io.fluidsonic.json.readFloatOrNull
+import io.fluidsonic.json.readFromMapByElementValue
+import io.fluidsonic.json.readIntOrNull
+import io.fluidsonic.json.readLongOrNull
+import io.fluidsonic.json.readShortOrNull
+import io.fluidsonic.json.readStringOrNull
+import io.fluidsonic.json.readValueOfType
+import io.fluidsonic.json.readValueOfTypeOrNull
+import io.fluidsonic.json.writeBooleanOrNull
+import io.fluidsonic.json.writeByteOrNull
+import io.fluidsonic.json.writeCharOrNull
+import io.fluidsonic.json.writeDoubleOrNull
+import io.fluidsonic.json.writeFloatOrNull
+import io.fluidsonic.json.writeIntOrNull
+import io.fluidsonic.json.writeIntoMap
+import io.fluidsonic.json.writeLongOrNull
+import io.fluidsonic.json.writeMapElement
+import io.fluidsonic.json.writeShortOrNull
+import io.fluidsonic.json.writeStringOrNull
+import io.fluidsonic.json.writeValueOrNull
+import kotlin.String
+
+internal object DataClassJsonCodec : AbstractJsonCodec() {
+ override fun JsonDecoder.decode(valueType: JsonCodingType):
+ DataClass {
+ var _value: String? = null
+
+ readFromMapByElementValue { key ->
+ when (key) {
+ "value" -> _value = readString()
+ else -> skipValue()
+ }
+ }
+
+ return DataClass(
+ value = _value ?: missingPropertyError("value")
+ )
+ }
+
+ override fun JsonEncoder.encode(value: DataClass) {
+ writeIntoMap {
+ writeMapElement("value", string = value.value)
+ }
+ }
+}
diff --git a/annotation-processor/tests/cases/1/output-expected/json/classes/GenericClassJSONCodec.kt b/annotation-processor/tests/cases/1/output-expected/json/classes/GenericClassJSONCodec.kt
deleted file mode 100644
index cbf3406..0000000
--- a/annotation-processor/tests/cases/1/output-expected/json/classes/GenericClassJSONCodec.kt
+++ /dev/null
@@ -1,66 +0,0 @@
-package json.classes
-
-import codecProvider.CustomCodingContext
-import com.github.fluidsonic.fluid.json.AbstractJSONCodec
-import com.github.fluidsonic.fluid.json.JSONCodingType
-import com.github.fluidsonic.fluid.json.JSONDecoder
-import com.github.fluidsonic.fluid.json.JSONEncoder
-import com.github.fluidsonic.fluid.json.missingPropertyError
-import com.github.fluidsonic.fluid.json.readBooleanOrNull
-import com.github.fluidsonic.fluid.json.readByteOrNull
-import com.github.fluidsonic.fluid.json.readCharOrNull
-import com.github.fluidsonic.fluid.json.readDoubleOrNull
-import com.github.fluidsonic.fluid.json.readFloatOrNull
-import com.github.fluidsonic.fluid.json.readFromMapByElementValue
-import com.github.fluidsonic.fluid.json.readIntOrNull
-import com.github.fluidsonic.fluid.json.readLongOrNull
-import com.github.fluidsonic.fluid.json.readShortOrNull
-import com.github.fluidsonic.fluid.json.readStringOrNull
-import com.github.fluidsonic.fluid.json.readValueOfType
-import com.github.fluidsonic.fluid.json.readValueOfTypeOrNull
-import com.github.fluidsonic.fluid.json.writeBooleanOrNull
-import com.github.fluidsonic.fluid.json.writeByteOrNull
-import com.github.fluidsonic.fluid.json.writeCharOrNull
-import com.github.fluidsonic.fluid.json.writeDoubleOrNull
-import com.github.fluidsonic.fluid.json.writeFloatOrNull
-import com.github.fluidsonic.fluid.json.writeIntOrNull
-import com.github.fluidsonic.fluid.json.writeIntoMap
-import com.github.fluidsonic.fluid.json.writeLongOrNull
-import com.github.fluidsonic.fluid.json.writeMapElement
-import com.github.fluidsonic.fluid.json.writeShortOrNull
-import com.github.fluidsonic.fluid.json.writeStringOrNull
-import com.github.fluidsonic.fluid.json.writeValueOrNull
-import kotlin.Any
-
-internal object GenericClassJSONCodec : AbstractJSONCodec,
- CustomCodingContext>() {
- override fun JSONDecoder.decode(valueType: JSONCodingType>): GenericClass<*, *, *> {
- var _a: Any? = null
- var _b: GenericClass.Bound? = null
- var _c: Any? = null
-
- readFromMapByElementValue { key ->
- when (key) {
- "a" -> _a = readValueOfTypeOrNull(valueType.arguments[0])
- "b" -> _b = readValueOfType(valueType.arguments[1]) as GenericClass.Bound
- "c" -> _c = readValueOfType(valueType.arguments[2])
- else -> skipValue()
- }
- }
-
- return GenericClass(
- a = _a,
- b = _b ?: missingPropertyError("b"),
- c = _c ?: missingPropertyError("c")
- )
- }
-
- override fun JSONEncoder.encode(value: GenericClass<*, *, *>) {
- writeIntoMap {
- writeMapElement("a", value = value.a)
- writeMapElement("b", value = value.b)
- writeMapElement("c", value = value.c)
- }
- }
-}
diff --git a/annotation-processor/tests/cases/1/output-expected/json/classes/GenericClassJsonCodec.kt b/annotation-processor/tests/cases/1/output-expected/json/classes/GenericClassJsonCodec.kt
new file mode 100644
index 0000000..0324fb1
--- /dev/null
+++ b/annotation-processor/tests/cases/1/output-expected/json/classes/GenericClassJsonCodec.kt
@@ -0,0 +1,66 @@
+package json.classes
+
+import codecProvider.CustomCodingContext
+import io.fluidsonic.json.AbstractJsonCodec
+import io.fluidsonic.json.JsonCodingType
+import io.fluidsonic.json.JsonDecoder
+import io.fluidsonic.json.JsonEncoder
+import io.fluidsonic.json.missingPropertyError
+import io.fluidsonic.json.readBooleanOrNull
+import io.fluidsonic.json.readByteOrNull
+import io.fluidsonic.json.readCharOrNull
+import io.fluidsonic.json.readDoubleOrNull
+import io.fluidsonic.json.readFloatOrNull
+import io.fluidsonic.json.readFromMapByElementValue
+import io.fluidsonic.json.readIntOrNull
+import io.fluidsonic.json.readLongOrNull
+import io.fluidsonic.json.readShortOrNull
+import io.fluidsonic.json.readStringOrNull
+import io.fluidsonic.json.readValueOfType
+import io.fluidsonic.json.readValueOfTypeOrNull
+import io.fluidsonic.json.writeBooleanOrNull
+import io.fluidsonic.json.writeByteOrNull
+import io.fluidsonic.json.writeCharOrNull
+import io.fluidsonic.json.writeDoubleOrNull
+import io.fluidsonic.json.writeFloatOrNull
+import io.fluidsonic.json.writeIntOrNull
+import io.fluidsonic.json.writeIntoMap
+import io.fluidsonic.json.writeLongOrNull
+import io.fluidsonic.json.writeMapElement
+import io.fluidsonic.json.writeShortOrNull
+import io.fluidsonic.json.writeStringOrNull
+import io.fluidsonic.json.writeValueOrNull
+import kotlin.Any
+
+internal object GenericClassJsonCodec : AbstractJsonCodec,
+ CustomCodingContext>() {
+ override fun JsonDecoder.decode(valueType: JsonCodingType>): GenericClass<*, *, *> {
+ var _a: Any? = null
+ var _b: GenericClass.Bound? = null
+ var _c: Any? = null
+
+ readFromMapByElementValue { key ->
+ when (key) {
+ "a" -> _a = readValueOfTypeOrNull(valueType.arguments[0])
+ "b" -> _b = readValueOfType(valueType.arguments[1]) as GenericClass.Bound
+ "c" -> _c = readValueOfType(valueType.arguments[2])
+ else -> skipValue()
+ }
+ }
+
+ return GenericClass(
+ a = _a,
+ b = _b ?: missingPropertyError("b"),
+ c = _c ?: missingPropertyError("c")
+ )
+ }
+
+ override fun JsonEncoder.encode(value: GenericClass<*, *, *>) {
+ writeIntoMap {
+ writeMapElement("a", value = value.a)
+ writeMapElement("b", value = value.b)
+ writeMapElement("c", value = value.c)
+ }
+ }
+}
diff --git a/annotation-processor/tests/cases/1/output-expected/json/classes/InlineClassJSONCodec.kt b/annotation-processor/tests/cases/1/output-expected/json/classes/InlineClassJSONCodec.kt
deleted file mode 100644
index 755928f..0000000
--- a/annotation-processor/tests/cases/1/output-expected/json/classes/InlineClassJSONCodec.kt
+++ /dev/null
@@ -1,27 +0,0 @@
-package json.classes
-
-import codecProvider.CustomCodingContext
-import com.github.fluidsonic.fluid.json.AbstractJSONCodec
-import com.github.fluidsonic.fluid.json.JSONCodingType
-import com.github.fluidsonic.fluid.json.JSONDecoder
-import com.github.fluidsonic.fluid.json.JSONEncoder
-import com.github.fluidsonic.fluid.json.readBooleanOrNull
-import com.github.fluidsonic.fluid.json.readByteOrNull
-import com.github.fluidsonic.fluid.json.readCharOrNull
-import com.github.fluidsonic.fluid.json.readDoubleOrNull
-import com.github.fluidsonic.fluid.json.readFloatOrNull
-import com.github.fluidsonic.fluid.json.readIntOrNull
-import com.github.fluidsonic.fluid.json.readLongOrNull
-import com.github.fluidsonic.fluid.json.readShortOrNull
-import com.github.fluidsonic.fluid.json.readStringOrNull
-import com.github.fluidsonic.fluid.json.readValueOfType
-import com.github.fluidsonic.fluid.json.readValueOfTypeOrNull
-import com.github.fluidsonic.fluid.json.writeValueOrNull
-
-internal object InlineClassJSONCodec : AbstractJSONCodec() {
- override fun JSONDecoder.decode(valueType: JSONCodingType):
- InlineClass = InlineClass(value = readString())
- override fun JSONEncoder.encode(value: InlineClass) {
- writeString(value.value)
- }
-}
diff --git a/annotation-processor/tests/cases/1/output-expected/json/classes/InlineClassJsonCodec.kt b/annotation-processor/tests/cases/1/output-expected/json/classes/InlineClassJsonCodec.kt
new file mode 100644
index 0000000..becef50
--- /dev/null
+++ b/annotation-processor/tests/cases/1/output-expected/json/classes/InlineClassJsonCodec.kt
@@ -0,0 +1,27 @@
+package json.classes
+
+import codecProvider.CustomCodingContext
+import io.fluidsonic.json.AbstractJsonCodec
+import io.fluidsonic.json.JsonCodingType
+import io.fluidsonic.json.JsonDecoder
+import io.fluidsonic.json.JsonEncoder
+import io.fluidsonic.json.readBooleanOrNull
+import io.fluidsonic.json.readByteOrNull
+import io.fluidsonic.json.readCharOrNull
+import io.fluidsonic.json.readDoubleOrNull
+import io.fluidsonic.json.readFloatOrNull
+import io.fluidsonic.json.readIntOrNull
+import io.fluidsonic.json.readLongOrNull
+import io.fluidsonic.json.readShortOrNull
+import io.fluidsonic.json.readStringOrNull
+import io.fluidsonic.json.readValueOfType
+import io.fluidsonic.json.readValueOfTypeOrNull
+import io.fluidsonic.json.writeValueOrNull
+
+internal object InlineClassJsonCodec : AbstractJsonCodec() {
+ override fun JsonDecoder.decode(valueType: JsonCodingType):
+ InlineClass = InlineClass(value = readString())
+ override fun JsonEncoder.encode(value: InlineClass) {
+ writeString(value.value)
+ }
+}
diff --git a/annotation-processor/tests/cases/1/output-expected/json/classes/ObjectJSONCodec.kt b/annotation-processor/tests/cases/1/output-expected/json/classes/ObjectJSONCodec.kt
deleted file mode 100644
index ea5ea73..0000000
--- a/annotation-processor/tests/cases/1/output-expected/json/classes/ObjectJSONCodec.kt
+++ /dev/null
@@ -1,25 +0,0 @@
-package json.classes
-
-import codecProvider.CustomCodingContext
-import com.github.fluidsonic.fluid.json.AbstractJSONEncoderCodec
-import com.github.fluidsonic.fluid.json.JSONEncoder
-import com.github.fluidsonic.fluid.json.writeBooleanOrNull
-import com.github.fluidsonic.fluid.json.writeByteOrNull
-import com.github.fluidsonic.fluid.json.writeCharOrNull
-import com.github.fluidsonic.fluid.json.writeDoubleOrNull
-import com.github.fluidsonic.fluid.json.writeFloatOrNull
-import com.github.fluidsonic.fluid.json.writeIntOrNull
-import com.github.fluidsonic.fluid.json.writeIntoMap
-import com.github.fluidsonic.fluid.json.writeLongOrNull
-import com.github.fluidsonic.fluid.json.writeMapElement
-import com.github.fluidsonic.fluid.json.writeShortOrNull
-import com.github.fluidsonic.fluid.json.writeStringOrNull
-import com.github.fluidsonic.fluid.json.writeValueOrNull
-
-internal object ObjectJSONCodec : AbstractJSONEncoderCodec