Class RSQLFilterParser
- java.lang.Object
-
- com.broadleafcommerce.data.tracking.core.filtering.fetch.rsql.RSQLFilterParser
-
- All Implemented Interfaces:
FilterParser<cz.jirutka.rsql.parser.ast.Node>
public class RSQLFilterParser extends Object implements FilterParser<cz.jirutka.rsql.parser.ast.Node>
Default implementation ofJpaFilterParser
. Expects filter strings to be formatted according to the following syntax rules:- A valid RSQL string as described here: https://github.com/jirutka/rsql-parser
- There is an additional '=between=' operator that supports finding matches between a range of two values. This is usually used with numbers or dates. Syntax is [field]=between=(val1,val2)
- There is an additional '=isnull=' operator that supports finding matches whose field value is or is not null. Syntax is [field]=isnull=[true/false]
- Author:
- Jeff Fischer
-
-
Constructor Summary
Constructors Constructor Description RSQLFilterParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description cz.jirutka.rsql.parser.ast.Node
parse(String filters)
Parse a String containing a structured list of filter params into the appropriate query criteria type to be passed to the persistence layer query.
-
-
-
Method Detail
-
parse
@NonNull public cz.jirutka.rsql.parser.ast.Node parse(String filters)
Description copied from interface:FilterParser
Parse a String containing a structured list of filter params into the appropriate query criteria type to be passed to the persistence layer query. Will throw aParseException
if unable to parse the supplied filters string.- Specified by:
parse
in interfaceFilterParser<cz.jirutka.rsql.parser.ast.Node>
- Parameters:
filters
- The String containing the structured list of filter params- Returns:
- The query criteria defined by the generic type
-
-