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 of JpaFilterParser. 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
     
  • Method Summary

    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RSQLFilterParser

      public RSQLFilterParser()
  • Method Details

    • 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 a ParseException if unable to parse the supplied filters string.
      Specified by:
      parse in interface FilterParser<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