Examples of writeValue()


Examples of org.codehaus.jackson.map.ObjectMapper.writeValue()

        response.setStatus(HttpServletResponse.SC_OK);

        final PrintWriter writer = response.getWriter();
        ObjectMapper mapper = new ObjectMapper();
        mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
        mapper.writeValue(writer, logFiles);

        response.setStatus(HttpServletResponse.SC_OK);
    }

}
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.writeValue()

        }

        final Writer writer = new BufferedWriter(response.getWriter());
        ObjectMapper mapper = new ObjectMapper();
        mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
        mapper.writeValue(writer, output);

        response.setContentType("application/json");
        response.setStatus(HttpServletResponse.SC_OK);
    }
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.writeValue()

        final PrintWriter writer = response.getWriter();

        ObjectMapper mapper = new ObjectMapper();
        mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
        mapper.writeValue(writer, outputObject);

    }

    private Random getRandom(final HttpSession session)
    {
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.writeValue()

            final PrintWriter writer = response.getWriter();

            ObjectMapper mapper = new ObjectMapper();
            mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
            mapper.writeValue(writer, outputObject);
        }
    }

    private SubjectCreator getSubjectCreator(HttpServletRequest request)
    {
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.writeValue()

        response.setContentType("application/json");

        final PrintWriter writer = response.getWriter();
        ObjectMapper mapper = new ObjectMapper();
        mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
        mapper.writeValue(writer, object);
    }

    protected String[] getPathInfoElements(HttpServletRequest request)
    {
        String pathInfo = request.getPathInfo();
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.writeValue()

        }

        final PrintWriter writer = response.getWriter();
        ObjectMapper mapper = new ObjectMapper();
        mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
        mapper.writeValue(writer, logRecords);

        response.setStatus(HttpServletResponse.SC_OK);

    }
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.writeValue()

        list.remove(i);
      else
        i++;
    }

    mapper.writeValue(jgen, schemaMap);
    return writer.getBuffer().toString();
  }

  /**
   *  =============================
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.writeValue()

      ObjectMapper mapper = new ObjectMapper();
      JsonFactory factory = new JsonFactory();
      StringWriter writer = new StringWriter();
      JsonGenerator jgen = factory.createJsonGenerator(writer);
      jgen.useDefaultPrettyPrinter();
      mapper.writeValue(jgen, field);
      return writer.getBuffer().toString();
    }
    catch(Exception ex)
    {
      throw new RuntimeException(ex);
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.writeValue()

    Map<String, String> map = mapper.readValue(
        new ByteArrayInputStream(serialCpMult.getBytes(Charset.defaultCharset())), new TypeReference<Map<String, String>>(){});
    map.put("NonJsonKey", "Some value");
    map.put("cursorPartition", ppart.toJsonString());
    ByteArrayOutputStream bs = new ByteArrayOutputStream();
    mapper.writeValue(bs, map);
    cpMultCopy = new CheckpointMult(bs.toString());

    assertEquals(cpMultCopy.getCursorPartition(), ppart);
  }
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.writeValue()

        }
        if(_returnSCN)
        {
          ObjectMapper mapper = new ObjectMapper();
          StringWriter sw = new StringWriter();
          mapper.writeValue(sw, bfResponse);

          HttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
          response.setContent(ChannelBuffers.copiedBuffer(sw.toString(), CharsetUtil.UTF_8));
          response.setHeader(HttpHeaders.Names.CONTENT_TYPE, "text/plain; charset=UTF-8");
          e.getChannel().write(response);
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.