void toJSONString ( final Map < ReferenceEqualityKey < JSONReference > , CharSequence > jsonReferenceToId , final boolean includeNullValuedFields , final int depth , final int indentWidth , final StringBuilder buf ) { final boolean prettyPrint = indentWidth > 0 ; final int n = items . size ( ) ; if ( n == 0 ) { buf . append ( "[]" ) ; } else { buf . append ( ' ' ) ; if ( prettyPrint ) { buf . append ( ' ' ) ; } for ( int i = 0 ; i < n ; i ++ ) { final Object item = items . get ( i ) ; if ( prettyPrint ) { JSONUtils . indent ( depth + 1 , indentWidth , buf ) ; } JSONSerializer . jsonValToJSONString ( item , jsonReferenceToId , includeNullValuedFields , depth + 1 , indentWidth , buf ) ; if ( i < n - 1 ) { buf . append ( ' ' ) ; } if ( prettyPrint ) { buf . append ( ' ' ) ; } } if ( prettyPrint ) { JSONUtils . indent ( depth , indentWidth , buf ) ; } buf . append ( ' ' ) ; } }
Serialize this JSONArray to a string .