Examples of writerWithDefaultPrettyPrinter()


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

    }

    String configObjectString;
    try {
      if (config.isDebug()) {
        configObjectString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(modelObject);
      } else {
        configObjectString = mapper.writeValueAsString(modelObject);
      }

    } catch (JsonGenerationException e) {
View Full Code Here

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

    }

    String configObjectString;
    try {
      if (config.isDebug()) {
        configObjectString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(modelObject);
      } else {
        configObjectString = mapper.writeValueAsString(modelObject);
      }

    } catch (JsonGenerationException e) {
View Full Code Here

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

        SchemaFactoryWrapper visitor = new SchemaFactoryWrapper();
        try {
            mapper.acceptJsonFormatVisitor(clazz, visitor);

            JsonSchema schema = visitor.finalSchema();
            return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(schema);

        } catch (JsonMappingException e) {
            log.error("Error occurred while generating JSON schema for the class ["+clazz+"]",e);
        } catch (JsonProcessingException e) {
            log.error("Error occurred while generating JSON schema for the class ["+clazz+"]",e);
View Full Code Here

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

      getLog().info("Writing results into " + outputFile.getName());
     
      try {
        ObjectMapper objectMapper = new ObjectMapper();
       
        ObjectWriter writer = objectMapper.writerWithDefaultPrettyPrinter();
       
        writer.writeValue(outputFile, result.getEnvironments());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
View Full Code Here

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

    public static String json(Object object) {
        try {
      Boolean debug = Boolean.valueOf(AdaptrexServices.getConfig().get(AdaptrexConfig.DEBUG));
      ObjectMapper mapper = new ObjectMapper();
            if (debug) {
                ObjectWriter writer = mapper.writerWithDefaultPrettyPrinter();
                return writer.writeValueAsString(object);
            } else {
                return mapper.writeValueAsString(object);
            }
        } catch (Exception e) {
View Full Code Here

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

    }

    String configObjectString;
    try {
      if (config.isDebug()) {
        configObjectString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(modelObject);
      } else {
        configObjectString = mapper.writeValueAsString(modelObject);
      }

    } catch (JsonGenerationException e) {
View Full Code Here

Examples of com.fasterxml.jackson.dataformat.xml.XmlMapper.writerWithDefaultPrettyPrinter()

        l.add(r2);

        // to see what JAXB might do, uncomment:
//System.out.println("By JAXB: "+jaxbSerialized(l)); //  ArrayList.class, SampleResource.class));

        String xml = xmlMapper
            .writerWithDefaultPrettyPrinter()
            .writeValueAsString(l)
            .trim();

        // first trivial sanity checks
View Full Code Here

Examples of io.druid.jackson.DefaultObjectMapper.writerWithDefaultPrettyPrinter()

        102937
    );

    task = VersionConverterTask.create(segment);

    task2 = jsonMapper.readValue(jsonMapper.writerWithDefaultPrettyPrinter().writeValueAsString(task), Task.class);
    Assert.assertEquals(task, task2);
  }
}
View Full Code Here

Examples of io.druid.jackson.DefaultObjectMapper.writerWithDefaultPrettyPrinter()

    String hostname = cmd.getOptionValue("e", "localhost:8080");
    String sql = cmd.getArgs().length > 0 ? cmd.getArgs()[0] : STATEMENT;

    ObjectMapper objectMapper = new DefaultObjectMapper();
    ObjectWriter jsonWriter = objectMapper.writerWithDefaultPrettyPrinter();

    CharStream stream = new ANTLRInputStream(sql);
    DruidSQLLexer lexer = new DruidSQLLexer(stream);
    TokenStream tokenStream = new CommonTokenStream(lexer);
    DruidSQLParser parser = new DruidSQLParser(tokenStream);
View Full Code Here

Examples of io.druid.jackson.DefaultObjectMapper.writerWithDefaultPrettyPrinter()

    DefaultObjectMapper jsonMapper = new DefaultObjectMapper();

    VersionConverterTask task = VersionConverterTask.create(dataSource, interval);

    Task task2 = jsonMapper.readValue(jsonMapper.writerWithDefaultPrettyPrinter().writeValueAsString(task), Task.class);
    Assert.assertEquals(task, task2);

    DataSegment segment = new DataSegment(
        dataSource,
        interval,
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.