It can be performed in a two-step process:
1) Convert the object to JSON using any of your library, for example. jackson :
ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter(); String json = ow.writeValueAsString(object);
2) Convert the JSON string to HTML using a ready-made solution like json2html or do your own implementation. Take a look at the visualizer demo:
ccpizza
source share