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 .