Examples of DefaultPrettyPrinter


Examples of org.codehaus.jackson.util.DefaultPrettyPrinter

     *
     * @since 1.6
     */
    public ObjectWriter withDefaultPrettyPrinter()
    {
        return withPrettyPrinter(new DefaultPrettyPrinter());
    }
View Full Code Here

Examples of org.codehaus.jackson.util.DefaultPrettyPrinter

  private ByteArrayOutputStream init() throws IOException {
    ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
    m_generator = createJsonGenerator(bytesOut);

    DefaultPrettyPrinter p = new DefaultPrettyPrinter();
    p.indentArraysWith(new DefaultPrettyPrinter.Lf2SpacesIndenter());
    m_generator.setPrettyPrinter(p);

    return bytesOut;
  }
View Full Code Here

Examples of org.codehaus.jackson.util.DefaultPrettyPrinter

  private JsonGenerator createJsonGenerator(ByteArrayOutputStream baos) throws IOException {
    JsonGenerator generator = m_factory.createJsonGenerator(new OutputStreamWriter(baos,
        Charset.forName("UTF-8").newEncoder()));

    DefaultPrettyPrinter p = new DefaultPrettyPrinter();
    p.indentArraysWith(new DefaultPrettyPrinter.Lf2SpacesIndenter());
    generator.setPrettyPrinter(p);

    return generator;
  }
View Full Code Here

Examples of org.codehaus.jackson.util.DefaultPrettyPrinter

     *
     * @since 1.6
     */
    public ObjectWriter withDefaultPrettyPrinter()
    {
        return withPrettyPrinter(new DefaultPrettyPrinter());
    }
View Full Code Here

Examples of org.codehaus.jackson.util.DefaultPrettyPrinter

    final JsonGenerator generator = JSON_FACTORY.createJsonGenerator(stringWriter);
    // We have disabled this because we used unions to represent row key formats
    // in the table layout. This is a HACK and needs a better solution.
    // TODO: Find better solution. https://jira.kiji.org/browse/SCHEMA-174
    //generator.disable(Feature.QUOTE_FIELD_NAMES);
    generator.setPrettyPrinter(new DefaultPrettyPrinter());
    final ObjectMapper mapper = new ObjectMapper();
    mapper.writeValue(generator, node);
    return stringWriter.toString();
  }
View Full Code Here

Examples of org.codehaus.jackson.util.DefaultPrettyPrinter

  private ByteArrayOutputStream init() throws IOException {
    ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
    m_generator = createJsonGenerator(bytesOut);

    DefaultPrettyPrinter p = new DefaultPrettyPrinter();
    p.indentArraysWith(new DefaultPrettyPrinter.Lf2SpacesIndenter());
    m_generator.setPrettyPrinter(p);

    return bytesOut;
  }
View Full Code Here

Examples of org.codehaus.jackson.util.DefaultPrettyPrinter

  private JsonGenerator createJsonGenerator(ByteArrayOutputStream baos) throws IOException {
    JsonGenerator generator = m_factory.createJsonGenerator(new OutputStreamWriter(baos,
        Charset.forName("UTF-8").newEncoder()));

    DefaultPrettyPrinter p = new DefaultPrettyPrinter();
    p.indentArraysWith(new DefaultPrettyPrinter.Lf2SpacesIndenter());
    generator.setPrettyPrinter(p);

    return generator;
  }
View Full Code Here

Examples of org.codehaus.jackson.util.DefaultPrettyPrinter

            }
            StringWriter out = new StringWriter();

            // Create pretty printer:
            JsonGenerator gen = fac.createJsonGenerator(out);
            DefaultPrettyPrinter pp = new DefaultPrettyPrinter();
            pp.indentArraysWith(new DefaultPrettyPrinter.Lf2SpacesIndenter());
            gen.setPrettyPrinter(pp);

            // Now write:
            jsonObjMapper.writeTree(gen, node);
           
View Full Code Here

Examples of org.codehaus.jackson.util.DefaultPrettyPrinter

     *
     * @since 1.6
     */
    public ObjectWriter withDefaultPrettyPrinter()
    {
        return withPrettyPrinter(new DefaultPrettyPrinter());
    }
View Full Code Here

Examples of org.codehaus.jackson.util.DefaultPrettyPrinter

    }

    @Override
    public final JsonGenerator useDefaultPrettyPrinter()
    {
        return setPrettyPrinter(new DefaultPrettyPrinter());
    }
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.