Domino-jackson offers flexibility in how you define mappers for your POJO (Plain Old Java Object) classes:
If you have access to the source code of your POJO class, you can easily generate mappers by annotating the class with JSONMapper. This approach automatically generates mappers and (de)serializers in the same package as your POJO. This is particularly handy when your POJO is part of your project's source code or when you want to ship the mappers alongside the POJO itself. JSONMapper> generates both deserializers and serializers for your POJO. However, there may be cases where you only need to read JSON without writing it, or vice versa. In such situations, you can utilize two additional annotations: JSONReader> for generating deserializers only and JSONWriter for generating serializers only.
@JSONMapper
interface PersonMapper extends ObjectMapper<Person>{}
this will generate the mapper in the same package as the interface and will use the interface as a base name, in this case the generated mapper is PersonMapperImpl.
to generate a reader only use
@JSONReader
interface PersonReader extends ObjectReader<Person>{}
and to generate a writer only use
@JSONWriter
interface PersonWriter extends ObjectWriter<Person>{}
If you are generating a mapper for a data type that is not represented by a bean but rather with data structure types, for example HashMap<String, List<String>> you can utilize the interface style for this:
@JSONMapper
interface SomeHashMapMapper extends ObjectMapper<HashMap<String, List<String>>>{}
And this applies to any datatype supported by the library.