public static String toJson ( Workspace workspace , boolean indentOutput ) throws Exception { if ( workspace == null ) { throw new IllegalArgumentException ( "A workspace must be provided." ) ; } JsonWriter jsonWriter = new JsonWriter ( indentOutput ) ; StringWriter stringWriter = new StringWriter ( ) ; jsonWriter . write ( workspace , stringWriter ) ; stringWriter . flush ( ) ; stringWriter . close ( ) ; return stringWriter . toString ( ) ; }
Serializes the specified workspace to a JSON string .