Renders a list of rows as text/csv, converting each row's values to text with the current Formatter. Built from a plain list of rows via ViewsBuilder.csvView(...) in server-side JS, so each row can be a Java list or a script value (Nashorn ScriptObjectMirror or a Graal Value/PolyglotMapAndFunction), which is converted to a list before formatting. Supports partial output through a byte-offset range.

Group: Views

Implements: View, Serializable


Properties

PropertyReturnsDescription
contentTypeStringThe content type sent with the response, always "text/csv".
descriptionStringShort, user-facing label for this view, always "CSV view".

Methods

getDescription()

Returns: String

Short, user-facing label for this view, always "CSV view".

render(CommonResource page, OutputStream out, Range range, Map<String,String> params, String contentType)

Returns: void

Renders the rows as CSV text and writes it to the response, restricted to the requested byte range if any.

ParameterDescription
pagethe resource the view is being rendered for, not used by this view
outthe stream the CSV text is written to
rangeif given, only the bytes within this range are written
paramsrequest parameters, not used by this view
contentTypenot used by this view; getContentType() supplies the response content type

getContentType()

Returns: String

The content type sent with the response, always "text/csv".

toRange(String text, Range range)

Returns: String

Extracts the substring of the rendered CSV text falling within the given byte range, or the whole text if no range is given.

ParameterDescription
textthe full rendered CSV text
rangethe byte range to extract, or null to return the whole text
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.