Skip to content

Commit efc745e

Browse files
committed
Merge branch 'master' of github.com:FasterXML/jackson-module-kotlin
2 parents 69c0ea5 + 20d96c9 commit efc745e

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

Lines changed: 10 additions & 10 deletions
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

Lines changed: 24 additions & 20 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 5 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)