How to provide brand new jackson deserialization for object #219
-
In order to support object deserialization, jackson provides these ways
The first three didn't meet my requirements, and the implementation of the last one was flawed (I'm not Jackson expert. T_T). To explain this, we need to go back to my introduction of a completely new programming model for the JVM. In order to introduce a very powerful immutable object architecture to the JVM, my framework ported a poplular JavaScript framework immer: 26.8k github star to the JVM ecosystem. (If you are interested, please refer to: immutable) Now, we can declare immutable type like this
In order to create immutable object, developer can:
For example
Here, 'TreeNodeDraft' is the type that the Annotation Processor generates at compile time. The final print result is as follows.
This is a very powerful immutable object programming model that first appeared in the JVM. As a result, the I created ImmutableDeserializer to provide jackson deserialization for this new programming model. However, my implementation was unable to accommodate some of the advanced features of native Jackson, such as formatting control, @JsonAlias and polymorphism. Over the past nearly two years, users have submitted many related bugs, which has been bothering me a lot. Though I can use my way to let each broken features compatible with original behavior of jackson one by one, there seems to be no end in sight. Is there better solution to support brand new deserialization? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I found the solution |
Beta Was this translation helpful? Give feedback.
I found the solution
AnnotationIntrospector