congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
PrettyPrint
Code IndexAdd Tabnine to your IDE (free)

How to use
PrettyPrint
in
com.eclipsesource.json

Best Java code snippets using com.eclipsesource.json.PrettyPrint (Showing top 15 results out of 315)

origin: ralfstx/minimal-json

/**
 * Print every value on a separate line. Use tabs (<code>\t</code>) for indentation.
 *
 * @return A PrettyPrint instance for wrapped mode with tab indentation
 */
public static PrettyPrint singleLine() {
 return new PrettyPrint(null);
}
origin: com.github.wnameless/json-flattener

private WriterConfig getWriterConfig() {
 switch (printMode) {
  case REGULAR:
   return PrettyPrint.singleLine();
  case PRETTY:
   return WriterConfig.PRETTY_PRINT;
  default:
   return WriterConfig.MINIMAL;
 }
}
origin: wnameless/json-flattener

private WriterConfig getWriterConfig() {
 switch (printMode) {
  case REGULAR:
   return PrettyPrint.singleLine();
  case PRETTY:
   return WriterConfig.PRETTY_PRINT;
  default:
   return WriterConfig.MINIMAL;
 }
}
origin: ralfstx/minimal-json

/**
 * Do not break lines, but still insert whitespace between values.
 *
 * @return A PrettyPrint instance for single-line mode
 */
public static PrettyPrint indentWithTabs() {
 return new PrettyPrint(new char[] {'\t'});
}
origin: com.github.wnameless/json-flattener

public String toString(PrintMode printMode) {
 StringWriter sw = new StringWriter();
 try {
  switch (printMode) {
   case REGULAR:
    Json.parse(toString()).writeTo(sw, PrettyPrint.singleLine());
    break;
   case PRETTY:
    Json.parse(toString()).writeTo(sw, WriterConfig.PRETTY_PRINT);
    break;
   default:
    return toString();
  }
 } catch (IOException e) {}
 return sw.toString();
}
origin: ralfstx/minimal-json

/**
 * Print every value on a separate line. Use the given number of spaces for indentation.
 *
 * @param number
 *          the number of spaces to use
 * @return A PrettyPrint instance for wrapped mode with spaces indentation
 */
public static PrettyPrint indentWithSpaces(int number) {
 if (number < 0) {
  throw new IllegalArgumentException("number is negative");
 }
 char[] chars = new char[number];
 Arrays.fill(chars, ' ');
 return new PrettyPrint(chars);
}
origin: com.github.wnameless/json-flattener

public String toString(PrintMode printMode) {
 StringWriter sw = new StringWriter();
 try {
  switch (printMode) {
   case REGULAR:
    Json.parse(toString()).writeTo(sw, PrettyPrint.singleLine());
    break;
   case PRETTY:
    Json.parse(toString()).writeTo(sw, WriterConfig.PRETTY_PRINT);
    break;
   default:
    return toString();
  }
 } catch (IOException e) {}
 return sw.toString();
}
origin: com.eclipsesource.minimal-json/minimal-json

/**
 * Print every value on a separate line. Use tabs (<code>\t</code>) for indentation.
 *
 * @return A PrettyPrint instance for wrapped mode with tab indentation
 */
public static PrettyPrint singleLine() {
 return new PrettyPrint(null);
}
origin: wnameless/json-flattener

public String toString(PrintMode printMode) {
 StringWriter sw = new StringWriter();
 try {
  switch (printMode) {
   case REGULAR:
    Json.parse(toString()).writeTo(sw, PrettyPrint.singleLine());
    break;
   case PRETTY:
    Json.parse(toString()).writeTo(sw, WriterConfig.PRETTY_PRINT);
    break;
   default:
    return toString();
  }
 } catch (IOException e) {}
 return sw.toString();
}
origin: com.eclipsesource.minimal-json/minimal-json

/**
 * Do not break lines, but still insert whitespace between values.
 *
 * @return A PrettyPrint instance for single-line mode
 */
public static PrettyPrint indentWithTabs() {
 return new PrettyPrint(new char[] {'\t'});
}
origin: wnameless/json-flattener

public String toString(PrintMode printMode) {
 StringWriter sw = new StringWriter();
 try {
  switch (printMode) {
   case REGULAR:
    Json.parse(toString()).writeTo(sw, PrettyPrint.singleLine());
    break;
   case PRETTY:
    Json.parse(toString()).writeTo(sw, WriterConfig.PRETTY_PRINT);
    break;
   default:
    return toString();
  }
 } catch (IOException e) {}
 return sw.toString();
}
origin: ZencashOfficial/zencash-swing-wallet-ui

/**
 * Print every value on a separate line. Use tabs (<code>\t</code>) for indentation.
 *
 * @return A PrettyPrint instance for wrapped mode with tab indentation
 */
public static PrettyPrint singleLine() {
 return new PrettyPrint(null);
}
origin: ZencashOfficial/zencash-swing-wallet-ui

/**
 * Do not break lines, but still insert whitespace between values.
 *
 * @return A PrettyPrint instance for single-line mode
 */
public static PrettyPrint indentWithTabs() {
 return new PrettyPrint(new char[] {'\t'});
}
origin: ZencashOfficial/zencash-swing-wallet-ui

/**
 * Print every value on a separate line. Use the given number of spaces for indentation.
 *
 * @param number
 *          the number of spaces to use
 * @return A PrettyPrint instance for wrapped mode with spaces indentation
 */
public static PrettyPrint indentWithSpaces(int number) {
 if (number < 0) {
  throw new IllegalArgumentException("number is negative");
 }
 char[] chars = new char[number];
 Arrays.fill(chars, ' ');
 return new PrettyPrint(chars);
}
origin: com.eclipsesource.minimal-json/minimal-json

/**
 * Print every value on a separate line. Use the given number of spaces for indentation.
 *
 * @param number
 *          the number of spaces to use
 * @return A PrettyPrint instance for wrapped mode with spaces indentation
 */
public static PrettyPrint indentWithSpaces(int number) {
 if (number < 0) {
  throw new IllegalArgumentException("number is negative");
 }
 char[] chars = new char[number];
 Arrays.fill(chars, ' ');
 return new PrettyPrint(chars);
}
com.eclipsesource.jsonPrettyPrint

Javadoc

Enables human readable JSON output by inserting whitespace between values.after commas and colons. Example:
 
jsonValue.writeTo(writer, PrettyPrint.singleLine()); 

Most used methods

  • <init>
  • singleLine
    Print every value on a separate line. Use tabs (\t) for indentation.

Popular in Java

  • Making http requests using okhttp
  • setRequestProperty (URLConnection)
  • getSystemService (Context)
  • getContentResolver (Context)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now