Home » Miscellaneous Annotations in Jackson

Miscellaneous Annotations in Jackson

by Online Tutorials Library

Miscellaneous Annotations in Jackson

Custom annotation and MixIn annotation come in miscellaneous annotations. Miscellaneous annotations are used at the time of serializing and de-serializing Json.

Miscellaneous Annotations in Jackson

Let’s understand each one of them one by one with an example.

Custom Annotation

@JacksonAnnotationsInside is one of the most important annotations that help developers implement custom annotation. Let’s take an example to understand how to create and use custom annotation.

CustomAnnotationExample.java

Output:

Miscellaneous Annotations in Jackson

MixIn Annotation

If we want to associate annotations without modifying the target class, we use mixin annotation. Let’s take an example to understand how it is used for associating annotations.

MixInAnnotationExample.java

Output:

Miscellaneous Annotations in Jackson


You may also like