• Stars
    star
    270
  • Rank 152,189 (Top 3 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

JSON serialization/deserialization library for Kotlin data classes

JKid is a simple JSON serialization/deserialization library for Kotlin data classes. To serialize or deserialize an object use the 'serialize' and 'deserialize' functions.

This project accompanies the Chapter 10, "Introspecting Kotlin Code" of the Kotlin in Action book.

The section "Declaring and Applying Annotations" of the Chapter 10 describes annotations in Kotlin, and also shows how to use the library and how to tune it with annotations. You can find examples for this section in the folder test/kotlin/examples. Five examples correspond to five subsections accordingly. The file kotlin/Annotations.kt contains the declarations of discussed annotations.

The section "Reflection: Introspecting Kotlin Objects at Runtime" of the book describes the implementation of serializer and deserializer. The files main/kotlin/serialization/Serializer.kt and main/kotlin/deserialization/Deserializer.kt contain the source code.

We highly encourage you to do the following exercises after reading the text. The first exercise can be started after reading the description of the serializer, to be exact after reading the section "Customizing Serialization with Annotations". The second exercise is intended to be started after reading the whole chapter. Solving these exercises will help you to understand the concepts better and lets you practice right away.

  1. Support the annotation DateFormat, that allows to annotate the date property with @DateFormat("dd-MM-yyyy") specifying the date format as an argument. The testing example showing its usage is in the file test/kotlin/exercise/DateFormatAnnotation.kt. Remove @Ignore from the test DateFormatTest and make it pass. The declaration of the annotation is in the file main/kotlin/exercise/DateFormat.kt. The solution to this exercise can be found in the branch solution-date-format. You can use the action "compare with Branch..." to compare your solution with the suggested one.

  2. Make JKid support serialization and deserialization of maps as property values. For now it supports only objects and collections. The example is in the file test/kotlin/exercise/Map.kt. Remove @Ignore from the test MapTest and make it pass. To support deserialization of maps, create a class MapSeed similar to ObjectSeed and collection seeds. The function createSeedForType should now return an instance of MapSeed if a map is expected. The example solution can be found in the branch solution-map.

More Repositories

1

kxdate

Kotlin extensions for Java 8 java.time API
Kotlin
257
star
2

jitwatch-intellij

JITWatch plugin for IntelliJ IDEA
Kotlin
167
star
3

idiomatic-kotlin

Examples for "Idiomatic Kotlin" talk
Kotlin
80
star
4

kxhtml-isomorphic

Demo of multiplatform project using kotlinx.html and kotlinx.serialization
Kotlin
57
star
5

comparisonChainGen

Example plugin created during the "Live Coding an IntelliJ IDEA Plugin from Scratch" webinar.
Java
54
star
6

Gibbed.RED

The Witcher 2 reverse engineering
C#
24
star
7

structorian

Structorian is a tool which lets you describe formats of binary data in a powerful C-like language, and then view or edit the data in a structured view.
C#
22
star
8

etymograph

Kotlin
19
star
9

unhood

Decompiler for the UnrealEngine 3 version of UnrealScript
C#
18
star
10

kj2k

Kotlin rewrite of Java to Kotlin converter
Kotlin
8
star
11

faguirra

Two-pane file manager plugin for IntelliJ Platform-based IDEs
Kotlin
7
star
12

inkdc

Decompiler for Ink (https://github.com/inkle/ink/)
C#
7
star
13

hilangro

Exploration of a game mechanic based on reconstructing a simulated language family
Kotlin
5
star
14

kcabend

A backend for a certain Web service
Kotlin
5
star
15

ktrawler

Tool to analyze usage of Kotlin language features in accessible Kotlin projects.
Kotlin
4
star
16

aoc2021

Advent of Code 2021 in Python
Python
4
star
17

javafx-demo-plugin

IntelliJ plugin that demonstrates depending on the new JavaFX Runtme for Plugins
Java
3
star
18

conflued

IntelliJ IDEA plugin for offline editing of Atlassian Confluence pages
Java
2
star
19

copy-upsource-link

IntelliJ plugin to copy an Upsource link to the selected file to clipboard
Kotlin
2
star
20

gtpdiff

Diff between two Guitar Pro files
Python
1
star
21

coordinatrix

IntelliJ plugin to coordinate build/debug in multiple open projects / IDE instances
Kotlin
1
star
22

witless

The Witless, an automated puzzle solver for The Witness
Kotlin
1
star
23

simple_language_plugin

Unloadable simple language plugin
Java
1
star
24

historical-paternosters

Historical Pater Nosters Database
Kotlin
1
star