Class DataTablesRequest
DataTablesResults JSON output bean.
This bean is a faithful model of the
DataTables server-side request; it carries
no query-engine types and knows nothing about BeanQuery. The adapter in
org.apache.juneau.console.datatables.adapter maps a parsed instance onto a
BeanQuery.
Shape (fields omitted from the request keep their defaults):
{
Every property DataTables 2.x core sends is modelled (including search.fixed and order[].name, both new
in 2.x), so the request parses under Juneau's default strict bean parsing, which rejects unknown properties.
Any OTHER top-level property - one an application merges in through JuneauDataTables.ajax(url, {data:{...}}),
or one a DataTables extension adds (SearchBuilder's searchBuilder, SearchPanes' searchPanes) - is
collected into getExtra() instead of failing the parse. The adapter ignores it.
Example:
- Since:
- 10.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA DataTables column descriptor (columns[i]).static classA DataTables 2.x fixed search term (search.fixed[i]): a named search applied through the DataTables API (search.fixed(name, term)) rather than typed by the user.static classA DataTables ordering descriptor (order[i]): the index of the ordered column plus its direction.static classA DataTables search descriptor ({value, regex, fixed}), used for both the global search and a column search. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the column descriptors.intgetDraw()Returns the draw counter echoed back on the response.getExtra()Returns every top-level request property that is not one of the modelled DataTables properties.intReturns the number of records the page should return (-1means all records, no paging).getOrder()Returns the ordering descriptors.Returns the global search descriptor.intgetStart()Returns the 0-based index of the first record to return.setColumns(List<DataTablesRequest.Column> value) Sets the column descriptors.setDraw(int value) Sets the draw counter.voidRecords a top-level request property that is not one of the modelled DataTables properties.setLength(int value) Sets the number of records the page should return (-1means all records, no paging).setOrder(List<DataTablesRequest.Order> value) Sets the ordering descriptors.Sets the global search descriptor.setStart(int value) Sets the 0-based index of the first record to return.
-
Constructor Details
-
DataTablesRequest
public DataTablesRequest()
-
-
Method Details
-
getDraw
Returns the draw counter echoed back on the response.- Returns:
- The draw counter.
-
setDraw
Sets the draw counter.- Parameters:
value- The value.- Returns:
- This object.
-
getStart
Returns the 0-based index of the first record to return.- Returns:
- The paging start index.
-
setStart
Sets the 0-based index of the first record to return.- Parameters:
value- The value.- Returns:
- This object.
-
getLength
Returns the number of records the page should return (-1means all records, no paging).- Returns:
- The page length.
-
setLength
Sets the number of records the page should return (-1means all records, no paging).- Parameters:
value- The value.- Returns:
- This object.
-
getSearch
Returns the global search descriptor.- Returns:
- The global search, or
null if none.
-
setSearch
Sets the global search descriptor.- Parameters:
value- The value.- Returns:
- This object.
-
getColumns
Returns the column descriptors.- Returns:
- The columns, or
null if none.
-
setColumns
Sets the column descriptors.- Parameters:
value- The value.- Returns:
- This object.
-
getOrder
Returns the ordering descriptors.- Returns:
- The order entries, or
null if none.
-
setOrder
Sets the ordering descriptors.- Parameters:
value- The value.- Returns:
- This object.
-
getExtra
Returns every top-level request property that is not one of the modelled DataTables properties.For example the
tenantinJuneauDataTables.ajax(url, {data:{tenant:'x'}}), or an extension's own request key. Lets a handler read application parameters that ride the JSON body.- Returns:
- The extra properties, keyed by name. Never
null .
-
setExtra
Records a top-level request property that is not one of the modelled DataTables properties.- Parameters:
name- The property name.value- The property value.
-