Creating a json object using jackson

You need a JsonNodeFactory:

final JsonNodeFactory factory = JsonNodeFactory.instance;

This class has methods to create ArrayNodes, ObjectNodes, IntNodes, DecimalNodes, TextNodes and whatnot. ArrayNodes and ObjectNodes have convenience mutation methods for adding directly most JSON primitive (non container) values without having to go through the factory (well, internally, they reference this factory, that is why).

As to an ObjectMapper, note that it is both a serializer (ObjectWriter) and deserializer (ObjectReader).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)