You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 20, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+87Lines changed: 87 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -268,6 +268,93 @@ data class Dst(
268
268
)
269
269
```
270
270
271
+
#### Deserialization by creating your own custom deserialization annotations
272
+
If you cannot use `KColumnDeserializer`, you can deserialize it by creating a custom deserialization annotations and adding it to the parameter.
273
+
274
+
275
+
Custom deserialization annotation is made by defining a pair of `deserialization annotation` and `deserializer`.
276
+
As an example, we will show how to create a `LocalDateTimeDeserializer` that deserializes from `String` to `LocalDateTime`.
277
+
278
+
##### Create deserialization annotation
279
+
`@Target(AnnotationTarget.VALUE_PARAMETER)` and `KColumnDeserializeBy` annotation and several other annotations You can define a deserialization annotation by assigning a `KColumnDeserializeBy` annotation.
280
+
281
+
The argument of the `KColumnDeserializeBy` annotation requires the `KClass` of the deserializer.
282
+
In this example, it is `LocalDateTimeDeserializerImpl`.
283
+
284
+
Also, arguments defined in the annotation can be referenced from the deserializer.
0 commit comments