Skip to content

Commit 20d96c9

Browse files
Renamed "com.fasterxml.jackson" -> "tools.jackson" #598 (#599)
1 parent 7383ebb commit 20d96c9

File tree

118 files changed

+479
-462
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+479
-462
lines changed

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.13.+"
2525
Maven:
2626
```xml
2727
<dependency>
28-
<groupId>com.fasterxml.jackson.module</groupId>
28+
<groupId>tools.jackson.module</groupId>
2929
<artifactId>jackson-module-kotlin</artifactId>
3030
<version>2.13.4</version>
3131
</dependency>
@@ -40,16 +40,16 @@ To use, just register the Kotlin module with your ObjectMapper instance:
4040

4141
```kotlin
4242
// With Jackson 2.12 and later
43-
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
43+
import tools.jackson.module.kotlin.jacksonObjectMapper
4444
...
4545
val mapper = jacksonObjectMapper()
4646
// or
47-
import com.fasterxml.jackson.module.kotlin.registerKotlinModule
47+
import tools.jackson.module.kotlin.registerKotlinModule
4848
...
4949
val mapper = ObjectMapper().registerKotlinModule()
5050
// or
51-
import com.fasterxml.jackson.module.kotlin.jsonMapper
52-
import com.fasterxml.jackson.module.kotlin.kotlinModule
51+
import tools.jackson.module.kotlin.jsonMapper
52+
import tools.jackson.module.kotlin.kotlinModule
5353
...
5454
val mapper = jsonMapper {
5555
addModule(kotlinModule())
@@ -61,7 +61,7 @@ val mapper = jsonMapper {
6161

6262
```kotlin
6363
import com.fasterxml.jackson.databind.json.JsonMapper
64-
import com.fasterxml.jackson.module.kotlin.KotlinModule
64+
import tools.jackson.module.kotlin.KotlinModule
6565
...
6666
val mapper = JsonMapper.builder().addModule(KotlinModule()).build()
6767
```
@@ -73,16 +73,16 @@ val mapper = JsonMapper.builder().addModule(KotlinModule()).build()
7373

7474
```kotlin
7575
import com.fasterxml.jackson.databind.ObjectMapper
76-
import com.fasterxml.jackson.module.kotlin.KotlinModule
76+
import tools.jackson.module.kotlin.KotlinModule
7777
...
7878
val mapper = ObjectMapper().registerModule(KotlinModule())
7979
```
8080
</details>
8181

8282
A simple data class example:
8383
```kotlin
84-
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
85-
import com.fasterxml.jackson.module.kotlin.readValue
84+
import tools.jackson.module.kotlin.jacksonObjectMapper
85+
import tools.jackson.module.kotlin.readValue
8686

8787
data class MyStateObject(val name: String, val age: Int)
8888

@@ -104,7 +104,7 @@ Also, there are some convenient operator overloading extension functions for Jso
104104
import com.fasterxml.jackson.databind.node.ArrayNode
105105
import com.fasterxml.jackson.databind.node.ObjectNode
106106
import com.fasterxml.jackson.databind.node.JsonNodeFactory
107-
import com.fasterxml.jackson.module.kotlin.*
107+
import tools.jackson.module.kotlin.*
108108

109109
// ...
110110
val objectNode: ObjectNode = JsonNodeFactory.instance.objectNode()

pom.xml

+24-20
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
<id>viartemev</id>
4242
<name>Vyacheslav Artemyev</name>
4343
</developer>
44+
<developer>
45+
<id>realyusufismail</id>
46+
<name>Yusuf Arfan Ismail</name>
47+
</developer>
4448
</developers>
4549
<url>https://github.com/FasterXML/jackson-module-kotlin</url>
4650
<scm>
@@ -55,7 +59,7 @@
5559
<version.kotlin>1.6.21</version.kotlin>
5660

5761
<!-- Generate PackageVersion.java into this directory. -->
58-
<packageVersion.dir>com/fasterxml/jackson/module/kotlin</packageVersion.dir>
62+
<packageVersion.dir>tools/jackson/module/kotlin</packageVersion.dir>
5963
<packageVersion.package>${project.groupId}.kotlin</packageVersion.package>
6064

6165
<!-- Configuration properties for the OSGi maven-bundle-plugin -->
@@ -214,22 +218,22 @@
214218
</plugins>
215219
</build>
216220

217-
<!-- Alas, need to include snapshot reference since otherwise can not find
218-
snapshot of parent... -->
219-
<repositories>
220-
<repository>
221-
<id>sonatype-nexus-snapshots</id>
222-
<name>Sonatype Nexus Snapshots</name>
223-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
224-
<releases><enabled>false</enabled></releases>
225-
<snapshots><enabled>true</enabled></snapshots>
226-
</repository>
227-
<repository>
228-
<id>sonatype-old-nexus-snapshots</id>
229-
<name>Sonatype Nexus Snapshots (old)</name>
230-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
231-
<releases><enabled>false</enabled></releases>
232-
<snapshots><enabled>true</enabled></snapshots>
233-
</repository>
234-
</repositories>
235-
</project>
221+
<!-- Alas, need to include snapshot reference since otherwise can not find
222+
snapshot of parent... -->
223+
<repositories>
224+
<repository>
225+
<id>sonatype-nexus-snapshots</id>
226+
<name>Sonatype Nexus Snapshots</name>
227+
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
228+
<releases><enabled>false</enabled></releases>
229+
<snapshots><enabled>true</enabled></snapshots>
230+
</repository>
231+
<repository>
232+
<id>sonatype-old-nexus-snapshots</id>
233+
<name>Sonatype Nexus Snapshots (old)</name>
234+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
235+
<releases><enabled>false</enabled></releases>
236+
<snapshots><enabled>true</enabled></snapshots>
237+
</repository>
238+
</repositories>
239+
</project>

src/main/kotlin/com/fasterxml/jackson/module/kotlin/ConstructorValueCreator.kt renamed to src/main/kotlin/tools/jackson/module/kotlin/ConstructorValueCreator.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package com.fasterxml.jackson.module.kotlin
1+
package tools.jackson.module.kotlin
22

33
import kotlin.reflect.KFunction
44
import kotlin.reflect.jvm.isAccessible
55

6-
internal class ConstructorValueCreator<T>(override val callable: KFunction<T>) : ValueCreator<T>() {
6+
internal class ConstructorValueCreator<T>(override val callable: KFunction<T>) : tools.jackson.module.kotlin.ValueCreator<T>() {
77
override val accessible: Boolean = callable.isAccessible
88

99
init {

src/main/kotlin/com/fasterxml/jackson/module/kotlin/Exceptions.kt renamed to src/main/kotlin/tools/jackson/module/kotlin/Exceptions.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fasterxml.jackson.module.kotlin
1+
package tools.jackson.module.kotlin
22

33
import tools.jackson.core.JsonParser
44
import tools.jackson.databind.exc.MismatchedInputException

src/main/kotlin/com/fasterxml/jackson/module/kotlin/Extensions.kt renamed to src/main/kotlin/tools/jackson/module/kotlin/Extensions.kt

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fasterxml.jackson.module.kotlin
1+
package tools.jackson.module.kotlin
22

33
import tools.jackson.core.JsonParser
44
import tools.jackson.core.TreeNode
@@ -35,7 +35,10 @@ fun jsonMapper(initializer: JsonMapper.Builder.() -> Unit = {}): JsonMapper {
3535
return builder.build()
3636
}
3737

38-
fun jacksonObjectMapper(): ObjectMapper = jsonMapper { addModule(kotlinModule()) }
38+
//TODO: causing java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
39+
fun jacksonObjectMapper(): ObjectMapper =
40+
jsonMapper { addModule(kotlinModule()) }
41+
3942
fun jacksonMapperBuilder(): JsonMapper.Builder = JsonMapper.builder().addModule(kotlinModule())
4043

4144
// 22-Jul-2019, tatu: Can not be implemented same way as in 2.x, addition via mapper.builder():

src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinAnnotationIntrospector.kt renamed to src/main/kotlin/tools/jackson/module/kotlin/KotlinAnnotationIntrospector.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fasterxml.jackson.module.kotlin
1+
package tools.jackson.module.kotlin
22

33
import com.fasterxml.jackson.annotation.JsonCreator
44
import com.fasterxml.jackson.annotation.JsonProperty
@@ -204,7 +204,7 @@ internal class KotlinAnnotationIntrospector(private val context: JacksonModule.S
204204
}
205205

206206
private fun KFunction<*>.isMethodParameterRequired(index: Int): Boolean {
207-
return isParameterRequired(index+1)
207+
return isParameterRequired(index + 1)
208208
}
209209

210210
private fun KFunction<*>.isParameterRequired(index: Int): Boolean {

src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinDeserializers.kt renamed to src/main/kotlin/tools/jackson/module/kotlin/KotlinDeserializers.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fasterxml.jackson.module.kotlin
1+
package tools.jackson.module.kotlin
22

33
import tools.jackson.core.JsonParser
44
import tools.jackson.core.JsonToken.VALUE_NUMBER_INT

src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinFeature.kt renamed to src/main/kotlin/tools/jackson/module/kotlin/KotlinFeature.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fasterxml.jackson.module.kotlin
1+
package tools.jackson.module.kotlin
22

33
import java.util.BitSet
44
import kotlin.math.pow

src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinKeyDeserializers.kt renamed to src/main/kotlin/tools/jackson/module/kotlin/KotlinKeyDeserializers.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fasterxml.jackson.module.kotlin
1+
package tools.jackson.module.kotlin
22

33
import tools.jackson.core.JsonToken
44
import tools.jackson.core.exc.InputCoercionException

src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinKeySerializers.kt renamed to src/main/kotlin/tools/jackson/module/kotlin/KotlinKeySerializers.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fasterxml.jackson.module.kotlin
1+
package tools.jackson.module.kotlin
22

33
import com.fasterxml.jackson.annotation.JsonFormat
44
import tools.jackson.core.JsonGenerator

src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinMixins.kt renamed to src/main/kotlin/tools/jackson/module/kotlin/KotlinMixins.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fasterxml.jackson.module.kotlin
1+
package tools.jackson.module.kotlin
22

33
import com.fasterxml.jackson.annotation.JsonCreator
44
import com.fasterxml.jackson.annotation.JsonIgnore

src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinModule.kt renamed to src/main/kotlin/tools/jackson/module/kotlin/KotlinModule.kt

+20-19
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
package com.fasterxml.jackson.module.kotlin
1+
package tools.jackson.module.kotlin
22

3+
import tools.jackson.core.json.PackageVersion
34
import tools.jackson.databind.MapperFeature
45
import tools.jackson.databind.module.SimpleModule
5-
import com.fasterxml.jackson.module.kotlin.KotlinFeature.NullIsSameAsDefault
6-
import com.fasterxml.jackson.module.kotlin.KotlinFeature.NullToEmptyCollection
7-
import com.fasterxml.jackson.module.kotlin.KotlinFeature.NullToEmptyMap
8-
import com.fasterxml.jackson.module.kotlin.KotlinFeature.StrictNullChecks
9-
import com.fasterxml.jackson.module.kotlin.SingletonSupport.CANONICALIZE
10-
import com.fasterxml.jackson.module.kotlin.SingletonSupport.DISABLED
6+
import tools.jackson.module.kotlin.KotlinFeature.NullIsSameAsDefault
7+
import tools.jackson.module.kotlin.KotlinFeature.NullToEmptyCollection
8+
import tools.jackson.module.kotlin.KotlinFeature.NullToEmptyMap
9+
import tools.jackson.module.kotlin.KotlinFeature.StrictNullChecks
10+
import tools.jackson.module.kotlin.SingletonSupport.CANONICALIZE
11+
import tools.jackson.module.kotlin.SingletonSupport.DISABLED
1112
import java.util.*
1213
import kotlin.reflect.KClass
1314

@@ -26,7 +27,7 @@ fun Class<*>.isKotlinClass(): Boolean {
2627
* @param nullIsSameAsDefault Default false. Whether to treat null values as absent when deserializing, thereby
2728
* using the default value provided in Kotlin.
2829
* @param singletonSupport Default: DISABLED. Mode for singleton handling.
29-
* See {@link com.fasterxml.jackson.module.kotlin.SingletonSupport label}
30+
* See {@link tools.jackson.module.kotlin.SingletonSupport label}
3031
* @param strictNullChecks Default: false. Whether to check deserialized collections. With this disabled,
3132
* the default, collections which are typed to disallow null members
3233
* (e.g. List<String>) may contain null values after deserialization. Enabling it
@@ -44,7 +45,7 @@ class KotlinModule @Deprecated(
4445
.configure(KotlinFeature.SingletonSupport, singletonSupport)
4546
.configure(KotlinFeature.StrictNullChecks, strictNullChecks)
4647
.build()""",
47-
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
48+
"tools.jackson.module.kotlin.KotlinFeature"
4849
)
4950
) constructor(
5051
val reflectionCacheSize: Int = 512,
@@ -176,7 +177,7 @@ class KotlinModule @Deprecated(
176177
message = "Deprecated, use isEnabled(NullToEmptyCollection) instead.",
177178
replaceWith = ReplaceWith(
178179
"isEnabled(KotlinFeature.NullToEmptyCollection)",
179-
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
180+
"tools.jackson.module.kotlin.KotlinFeature"
180181
)
181182
)
182183
fun getNullToEmptyCollection(): Boolean =
@@ -186,7 +187,7 @@ class KotlinModule @Deprecated(
186187
message = "Deprecated, use configure(NullToEmptyCollection, enabled) instead.",
187188
replaceWith = ReplaceWith(
188189
"configure(KotlinFeature.NullToEmptyCollection, nullToEmptyCollection)",
189-
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
190+
"tools.jackson.module.kotlin.KotlinFeature"
190191
)
191192
)
192193
fun nullToEmptyCollection(nullToEmptyCollection: Boolean): Builder =
@@ -196,7 +197,7 @@ class KotlinModule @Deprecated(
196197
message = "Deprecated, use isEnabled(NullToEmptyMap) instead.",
197198
replaceWith = ReplaceWith(
198199
"isEnabled(KotlinFeature.NullToEmptyMap)",
199-
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
200+
"tools.jackson.module.kotlin.KotlinFeature"
200201
)
201202
)
202203
fun getNullToEmptyMap(): Boolean =
@@ -206,7 +207,7 @@ class KotlinModule @Deprecated(
206207
message = "Deprecated, use configure(NullToEmptyMap, enabled) instead.",
207208
replaceWith = ReplaceWith(
208209
"configure(KotlinFeature.NullToEmptyMap, nullToEmptyMap)",
209-
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
210+
"tools.jackson.module.kotlin.KotlinFeature"
210211
)
211212
)
212213
fun nullToEmptyMap(nullToEmptyMap: Boolean): Builder =
@@ -216,7 +217,7 @@ class KotlinModule @Deprecated(
216217
message = "Deprecated, use isEnabled(NullIsSameAsDefault) instead.",
217218
replaceWith = ReplaceWith(
218219
"isEnabled(KotlinFeature.NullIsSameAsDefault)",
219-
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
220+
"tools.jackson.module.kotlin.KotlinFeature"
220221
)
221222
)
222223
fun getNullIsSameAsDefault(): Boolean =
@@ -226,7 +227,7 @@ class KotlinModule @Deprecated(
226227
message = "Deprecated, use configure(NullIsSameAsDefault, enabled) instead.",
227228
replaceWith = ReplaceWith(
228229
"configure(KotlinFeature.NullIsSameAsDefault, nullIsSameAsDefault)",
229-
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
230+
"tools.jackson.module.kotlin.KotlinFeature"
230231
)
231232
)
232233
fun nullIsSameAsDefault(nullIsSameAsDefault: Boolean): Builder =
@@ -236,7 +237,7 @@ class KotlinModule @Deprecated(
236237
message = "Deprecated, use isEnabled(SingletonSupport) instead.",
237238
replaceWith = ReplaceWith(
238239
"isEnabled(KotlinFeature.SingletonSupport)",
239-
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
240+
"tools.jackson.module.kotlin.KotlinFeature"
240241
)
241242
)
242243
fun getSingletonSupport(): SingletonSupport =
@@ -249,7 +250,7 @@ class KotlinModule @Deprecated(
249250
message = "Deprecated, use configure(SingletonSupport, enabled) instead.",
250251
replaceWith = ReplaceWith(
251252
"configure(KotlinFeature.SingletonSupport, singletonSupport)",
252-
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
253+
"tools.jackson.module.kotlin.KotlinFeature"
253254
)
254255
)
255256
fun singletonSupport(singletonSupport: SingletonSupport): Builder =
@@ -262,7 +263,7 @@ class KotlinModule @Deprecated(
262263
message = "Deprecated, use isEnabled(StrictNullChecks) instead.",
263264
replaceWith = ReplaceWith(
264265
"isEnabled(KotlinFeature.StrictNullChecks)",
265-
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
266+
"tools.jackson.module.kotlin.KotlinFeature"
266267
)
267268
)
268269
fun getStrictNullChecks(): Boolean =
@@ -272,7 +273,7 @@ class KotlinModule @Deprecated(
272273
message = "Deprecated, use configure(StrictNullChecks, enabled) instead.",
273274
replaceWith = ReplaceWith(
274275
"configure(KotlinFeature.StrictNullChecks, strictNullChecks)",
275-
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
276+
"tools.jackson.module.kotlin.KotlinFeature"
276277
)
277278
)
278279
fun strictNullChecks(strictNullChecks: Boolean): Builder =

src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinNamesAnnotationIntrospector.kt renamed to src/main/kotlin/tools/jackson/module/kotlin/KotlinNamesAnnotationIntrospector.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fasterxml.jackson.module.kotlin
1+
package tools.jackson.module.kotlin
22

33
import com.fasterxml.jackson.annotation.JsonCreator
44
import com.fasterxml.jackson.annotation.JsonCreator.Mode

src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinObjectSingletonDeserializer.kt renamed to src/main/kotlin/tools/jackson/module/kotlin/KotlinObjectSingletonDeserializer.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fasterxml.jackson.module.kotlin
1+
package tools.jackson.module.kotlin
22

33
import tools.jackson.core.JsonParser
44
import tools.jackson.databind.BeanProperty

src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinSerializers.kt renamed to src/main/kotlin/tools/jackson/module/kotlin/KotlinSerializers.kt

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fasterxml.jackson.module.kotlin
1+
package tools.jackson.module.kotlin
22

33
import com.fasterxml.jackson.annotation.JsonFormat
44
import com.fasterxml.jackson.annotation.JsonValue
@@ -22,18 +22,21 @@ object SequenceSerializer : StdSerializer<Sequence<*>>(Sequence::class.java) {
2222
}
2323

2424
object UByteSerializer : StdSerializer<UByte>(UByte::class.java) {
25-
override fun serialize(value: UByte, gen: JsonGenerator, provider: SerializerProvider) =
25+
override fun serialize(value: UByte, gen: JsonGenerator, provider: SerializerProvider) {
2626
gen.writeNumber(value.toShort())
27+
}
2728
}
2829

2930
object UShortSerializer : StdSerializer<UShort>(UShort::class.java) {
30-
override fun serialize(value: UShort, gen: JsonGenerator, provider: SerializerProvider) =
31+
override fun serialize(value: UShort, gen: JsonGenerator, provider: SerializerProvider) {
3132
gen.writeNumber(value.toInt())
33+
}
3234
}
3335

3436
object UIntSerializer : StdSerializer<UInt>(UInt::class.java) {
35-
override fun serialize(value: UInt, gen: JsonGenerator, provider: SerializerProvider) =
37+
override fun serialize(value: UInt, gen: JsonGenerator, provider: SerializerProvider) {
3638
gen.writeNumber(value.toLong())
39+
}
3740
}
3841

3942
object ULongSerializer : StdSerializer<ULong>(ULong::class.java) {
@@ -151,4 +154,4 @@ internal class ValueClassStaticJsonValueSerializer<T> private constructor(
151154
.getStaticJsonValueGetter()
152155
?.let { ValueClassStaticJsonValueSerializer(innerClazz, it) }
153156
}
154-
}
157+
}

src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinValueDeserializerModifier.kt renamed to src/main/kotlin/tools/jackson/module/kotlin/KotlinValueDeserializerModifier.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fasterxml.jackson.module.kotlin
1+
package tools.jackson.module.kotlin
22

33
import tools.jackson.databind.BeanDescription
44
import tools.jackson.databind.DeserializationConfig

0 commit comments

Comments
 (0)