private JsonWriter newJsonWriter(Writer writer) throws IOException {
  if (generateNonExecutableJson) {
    writer.write(JSON_NON_EXECUTABLE_PREFIX);
  }
  JsonWriter jsonWriter=new JsonWriter(writer);
  if (prettyPrinting) {
    jsonWriter.setIndent("  ");
  }
  jsonWriter.setSerializeNulls(serializeNulls);
  return jsonWriter;
}

private JsonWriter newJsonWriter ( Writer writer ) throws IOException { if ( generateNonExecutableJson ) { writer . write ( JSON_NON_EXECUTABLE_PREFIX ) ; } JsonWriter jsonWriter = new JsonWriter ( writer ) ; if ( prettyPrinting ) { jsonWriter . setIndent ( "  " ) ; } jsonWriter . setSerializeNulls ( serializeNulls ) ; return jsonWriter ; }
returns a new json writer configured for this gson and with the non - execute prefix if that is configured .
