This may seem a little unusual, but I'm looking for an efficient way to convert / display a JsonNode to POJO .
I store some data of my model in json files, and I have to support a couple of versions of my model.
I load the json file into memory in JsonNode, apply a couple of version control strategies so that they match the latest version of my model.
ObjectMapper mapper = new ObjectMapper(); BufferedReader fileReader = new BufferedReader(new FileReader(projPath)); JsonNode rootNode = mapper.readTree(fileReader); //Upgrade our file in memory applyVersioningStrategy(rootNode); ProjectModel project = mapJsonNodeToProject(rootNode);
If there is no faster way to do this, I probably ended up just manually applying JsonNodes to my model
java json jackson
Alexandre Oct 31 '13 at 16:18 2013-10-31 16:18
source share