Currently JSONWriter's constructor extracts the wrapperFunction and namedListStyle from the request.
This patch adds a new constructor where these are passed in from JSONResponseWriter. This will allow us to decide in JSONResponseWriter which writer to construct based on the named list style.
There is precedent here - GeoJSONResponseWriter extracts geofield from the request and passes it to GeoJSONWriter.
- relates to
SOLR-9442 Add json.nl=arrnvp (array of NamedValuePair) style in JSONResponseWriter