import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;

import java.io.IOException;

public class Client {
    public static void main(String[] args) {
        String url = "http://109.231.122.54:50070/jmx?qry=Hadoop:service=NameNode,name=NameNodeInfo";
        RestTemplate restTemplate = new RestTemplate();
        ResponseEntity<?> response = restTemplate.getForEntity(url, String.class);

        ObjectMapper mapper = new ObjectMapper();
        String body = response.getBody().toString();//.replaceAll("\\\\","");
        JsonNode rootNode = null;

        try {
            rootNode = mapper.readTree(body);
            JsonNode liveNodes = rootNode.findPath("LiveNodes");

            String lnString = liveNodes.toString();
            lnString = lnString.replaceAll("\\\\", "");
            lnString = lnString.substring(1, lnString.length() - 1);
            JsonNode lNodes = mapper.readTree(lnString);

            ((ObjectNode)rootNode.findPath("beans").get(0)).replace("LiveNodes",lNodes);
            //System.out.println(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(rootNode));
            System.out.println(rootNode.findPath("dice.cdh5.w6.internal"));

        } catch (IOException e1) {
            e1.printStackTrace();
        }

    }
}

@@ -144,24 +144,45 @@
 ObjectNode;%0A
+import dao.LiveNode;%0A
 import org.s
@@ -297,16 +297,36 @@
 ception;
+%0Aimport java.util.*;
 %0A%0Apublic
@@ -627,17 +627,16 @@
 class);%0A
-%0A
         
@@ -689,21 +689,33 @@
     
-String body =
+correctJsonString(mapper,
  res
@@ -744,34 +744,98 @@
 ng()
-;//.replaceAll(%22%5C%5C%5C%5C%22,%22%22);
+);%0A    %7D%0A%0A    public static JsonNode correctJsonString(ObjectMapper mapper, String body) %7B
 %0A   
@@ -926,16 +926,162 @@
 (body);%0A
+%0A            List%3CString%3E nodeTypes = Arrays.asList(%22LiveNodes%22, %22DeadNodes%22, %22DecomNodes%22);%0A%0A            for (String nodeType : nodeTypes) %7B%0A    
         
@@ -1127,23 +1127,23 @@
 ath(
-%22LiveNodes%22);%0A%0A
+nodeType);%0A    
     
@@ -1194,32 +1194,36 @@
 ();%0A            
+    
 lnString = lnStr
@@ -1254,32 +1254,36 @@
 %22);%0A            
+  
+  
 lnString = lnStr
@@ -1323,16 +1323,20 @@
 ) - 1);%0A
+    
         
@@ -1384,17 +1384,20 @@
 tring);%0A
-%0A
+    
         
@@ -1413,16 +1413,17 @@
 ectNode)
+ 
 rootNode
@@ -1457,28 +1457,26 @@
 replace(
-%22LiveNodes%22,
+nodeType, 
 lNodes);
@@ -1488,18 +1488,30 @@
         
-//
+%7D%0A            
 System.o
@@ -1588,24 +1588,26 @@
 rootNode));%0A
+%0A%0A
             
@@ -1610,72 +1610,512 @@
     
-System.out.println(rootNode.findPath(%22dice.cdh5.w6.internal%22));%0A
+JsonNode nodes =  rootNode.findPath(%22LiveNodes%22);%0A%0A            Iterator%3CMap.Entry%3CString, JsonNode%3E%3E nodeIterator = nodes.fields();%0A            while(nodeIterator.hasNext()) %7B%0A                Map.Entry%3CString, JsonNode%3E jsonParam = nodeIterator.next();%0A                String nodeName = jsonParam.getKey();%0A                LiveNode liveNode = mapper.treeToValue(jsonParam.getValue(), LiveNode.class);%0A                System.out.println(nodeName + %22 %22 + liveNode.getInfoAddr());%0A            %7D%0A            
 %0A   
@@ -2195,12 +2195,37 @@
  %7D%0A%0A
+        return rootNode;%0A
     %7D%0A
-%7D
 %0A
+%7D

Transform String node in JSON node and read data from it.