Package com.fasterxml.jackson.databind

Examples of com.fasterxml.jackson.databind.ObjectMapper.readTree()


    PartsLexer pl = new PartsLexer();
    parts.add(pl.parse(".author", 1));
    PartsParser pp = new PartsParser(parts);
    ObjectMapper om = new ObjectMapper();
    JsonNode json = om.readTree(content);
    JsonNode jsonData = om.readTree(data);
    try{
      assertTrue(json.has("author"));
      assertEquals("swampie",json.get("author").get("name").asText());
      JsonNode n = JsonTree.write(json, pp, jsonData.get("data"));
      assertEquals("giastfader",n.get("name").asText());
View Full Code Here


    List<PartsLexer.Part> parts = new ArrayList<PartsLexer.Part>();
    PartsLexer pl = new PartsLexer();
    parts.add(pl.parse(".author", 1));
    PartsParser pp = new PartsParser(parts);
    ObjectMapper om = new ObjectMapper();
    JsonNode json = om.readTree(content);
    JsonNode jsonData = om.readTree(data);
    try{
      assertTrue(json.has("author"));
      assertFalse(json.get("author").has("role"));
      JsonNode n = JsonTree.write(json, pp, jsonData.get("data"));
View Full Code Here

    PartsLexer pl = new PartsLexer();
    parts.add(pl.parse(".author", 1));
    PartsParser pp = new PartsParser(parts);
    ObjectMapper om = new ObjectMapper();
    JsonNode json = om.readTree(content);
    JsonNode jsonData = om.readTree(data);
    try{
      assertTrue(json.has("author"));
      assertFalse(json.get("author").has("role"));
      JsonNode n = JsonTree.write(json, pp, jsonData.get("data"));
      assertEquals("Consultant",n.get("role").asText());
View Full Code Here

    PartsLexer pl = new PartsLexer();
    parts.add(pl.parse(".author", 1));
    parts.add(pl.parse(".roles[2]", 2));
    PartsParser pp = new PartsParser(parts);
    ObjectMapper om = new ObjectMapper();
    JsonNode json = om.readTree(content);
    JsonNode jsonData = om.readTree(data);
    try{
      assertTrue(json.has("author"));
      assertTrue(json.get("author").has("roles"));
      assertEquals(2,json.get("author").get("roles").size());
View Full Code Here

    parts.add(pl.parse(".author", 1));
    parts.add(pl.parse(".roles[2]", 2));
    PartsParser pp = new PartsParser(parts);
    ObjectMapper om = new ObjectMapper();
    JsonNode json = om.readTree(content);
    JsonNode jsonData = om.readTree(data);
    try{
      assertTrue(json.has("author"));
      assertTrue(json.get("author").has("roles"));
      assertEquals(2,json.get("author").get("roles").size());
      JsonTree.write(json, pp, jsonData.get("data"));
View Full Code Here

         reader.close();
        
         long start = System.nanoTime();
        
         ObjectMapper om = new ObjectMapper();
         JsonNode jn = om.readTree(content.toString());
        
         List<PartsLexer.Part> parts = new ArrayList<PartsLexer.Part>();
     PartsLexer pl = new PartsLexer();
     parts.add(pl.parse(".resources", 1));
     parts.add(pl.parse(".about", 2));
View Full Code Here

         reader.close();
        
         String data = "{\"data\":\"http://baasbox.com\"}";
         long start = System.nanoTime();
         ObjectMapper om = new ObjectMapper();
         JsonNode jn = om.readTree(content.toString());
         JsonNode jsonData = om.readTree(data);
         List<PartsLexer.Part> parts = new ArrayList<PartsLexer.Part>();
     PartsLexer pl = new PartsLexer();
     parts.add(pl.parse(".resources", 1));
     parts.add(pl.parse(".about", 2));
View Full Code Here

        
         String data = "{\"data\":\"http://baasbox.com\"}";
         long start = System.nanoTime();
         ObjectMapper om = new ObjectMapper();
         JsonNode jn = om.readTree(content.toString());
         JsonNode jsonData = om.readTree(data);
         List<PartsLexer.Part> parts = new ArrayList<PartsLexer.Part>();
     PartsLexer pl = new PartsLexer();
     parts.add(pl.parse(".resources", 1));
     parts.add(pl.parse(".about", 2));
     parts.add(pl.parse(".methods", 3));
View Full Code Here

                req = req.withHeader(TestConfig.KEY_APPCODE,TestConfig.VALUE_APPCODE);
                req = req.withHeader(TestConfig.KEY_AUTH,TestConfig.encodeAuth(USER,USER));
                req =req.withJsonBody(node);
                Result res = routeAndCall(req);
                String content = contentAsString(res);
                JsonNode response = mapper.readTree(content);
                assertEquals(TEST_COLLECTION,response.get("data").get("@class").asText());
                assertNotNull(response.get("data").get("id"));


            }catch (Throwable e){
View Full Code Here

            request = request.withHeader(TestConfig.KEY_AUTH, TestConfig.AUTH_ADMIN_ENC);
            Result result = routeAndCall(request);

            JsonNode configuration = null;
            try{
              configuration = mp.readTree(contentAsString(result));
            }catch(Exception e){

            }

            originalValue = findInConfigurationDump(configuration,"Push","push","profile1.sandbox.ios.certificate.password");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.