Package org.apache.juneau.rest.converter
Class Queryable
java.lang.Object
org.apache.juneau.rest.converter.Queryable
- All Implemented Interfaces:
RestConverter
Converter for enabling of search/view/sort/page support on response objects returned by a @RestOp -annotated method.
When enabled, objects in a POJO tree can be filtered using the functionality described in the ObjectSearcher
,
ObjectViewer
, ObjectSorter
, and ObjectPaginator
classes.
The following HTTP request parameters are available for tabular data (e.g. Collections
of Maps
,
arrays of beans, etc...):
-
&s= Search arguments.
Comma-delimited list of key/value pairs representing column names and search tokens.
Example:&s=name=Bill*,birthDate>2000
-
&v= Visible columns.
Comma-delimited list of column names to display.
Example:&v=name,birthDate
-
&o= Sort commands.
Comma-delimited list of columns to sort by.
Column names can be suffixed with'+' or'-' to indicate ascending or descending order.
The default is ascending order.
Example:&o=name,birthDate-
-
&i= Case-insensitive parameter.
Boolean flag for case-insensitive matching on the search parameters. -
&p= - Position parameter.
Only return rows starting at the specified index position (zero-indexed).
Default is0
. -
&l= Limit parameter.
Only return the specified number of rows.
Default is0
(meaning return all rows).
See Also:
ObjectSearcher
- Additional information on searching POJO models.ObjectViewer
- Additional information on filtering POJO models.ObjectSorter
- Additional information on sorting POJO models.ObjectPaginator
- Additional information on paginating POJO models.RestOpContext.Builder.converters()
- Registering converters with REST resources.- Converters
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconvert
(RestRequest req, Object o) Performs post-call conversion on the specified response object.
-
Field Details
-
SWAGGER_PARAMS
Swagger parameters for this converter.- See Also:
-
-
Constructor Details
-
Queryable
public Queryable()
-
-
Method Details
-
convert
Description copied from interface:RestConverter
Performs post-call conversion on the specified response object.- Specified by:
convert
in interfaceRestConverter
- Parameters:
req
- The servlet request.o
- The response object set by the REST method through theRestResponse.setContent(Object)
method.- Returns:
- The converted object.
-