Class DefaultRSQLEvaluationService<P extends Product>
java.lang.Object
com.broadleafcommerce.catalog.service.rsql.DefaultRSQLEvaluationService<P>
- All Implemented Interfaces:
RSQLEvaluationService<P>
public class DefaultRSQLEvaluationService<P extends Product>
extends Object
implements RSQLEvaluationService<P>
-
Constructor Summary
ConstructorDescriptionDefaultRSQLEvaluationService
(com.broadleafcommerce.data.tracking.core.filtering.fetch.rsql.RSQLArgumentParser argumentParser) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
evaluateRSQLExpression
(cz.jirutka.rsql.parser.ast.ComparisonNode comparisonNode, P product) Evaluated the expression against a product based on a comparisonNode
.evaluateRSQLExpression
(cz.jirutka.rsql.parser.ast.LogicalNode logicalNode, P product) Evaluated the expression against a product based on a logicalNode
.evaluateRSQLExpression
(cz.jirutka.rsql.parser.ast.Node node, P product) Evaluated the expression against a product based on a genericNode
.evaluateRSQLExpression
(String selector, cz.jirutka.rsql.parser.ast.ComparisonOperator operator, List<String> arguments, P product) Evaluated the expression against a product based on a set of comparison parameters.protected Boolean
handleBetween
(List<Object> parsed, Object property) protected Boolean
handleEqual
(Object arg, boolean isString, boolean isRegex, Object property) protected Boolean
handleEqualIgnoreCase
(Object arg, boolean isRegex, Object property) protected Boolean
handleGreaterThan
(Object arg, Object property) protected Boolean
handleGreaterThanOrEqual
(Object arg, Object property) protected Boolean
handleIn
(Collection<?> arg, Object property) protected Boolean
handleLessThan
(Object arg, Object property) protected Boolean
handleLessThanOrEqual
(Object arg, Object property) protected Boolean
handleNull
(Object arg, Object property)
-
Constructor Details
-
DefaultRSQLEvaluationService
public DefaultRSQLEvaluationService(com.broadleafcommerce.data.tracking.core.filtering.fetch.rsql.RSQLArgumentParser argumentParser)
-
-
Method Details
-
evaluateRSQLExpression
Description copied from interface:RSQLEvaluationService
Evaluated the expression against a product based on a genericNode
.- Specified by:
evaluateRSQLExpression
in interfaceRSQLEvaluationService<P extends Product>
- Parameters:
node
- A generic node structure in a structured RSQL queryproduct
- The product to evaluate against- Returns:
- true if the product matches the criteria, false otherwise
-
evaluateRSQLExpression
public Boolean evaluateRSQLExpression(cz.jirutka.rsql.parser.ast.LogicalNode logicalNode, P product) Description copied from interface:RSQLEvaluationService
Evaluated the expression against a product based on a logicalNode
. Logical nodes are 'and'/'or' combinations of comparison nodes.- Specified by:
evaluateRSQLExpression
in interfaceRSQLEvaluationService<P extends Product>
- Parameters:
logicalNode
- A logical node structure in a structured RSQL queryproduct
- The product to evaluate against- Returns:
- true if the product matches the criteria, false otherwise
-
evaluateRSQLExpression
public Boolean evaluateRSQLExpression(cz.jirutka.rsql.parser.ast.ComparisonNode comparisonNode, P product) Description copied from interface:RSQLEvaluationService
Evaluated the expression against a product based on a comparisonNode
. Comparison nodes filter values on a specific field.- Specified by:
evaluateRSQLExpression
in interfaceRSQLEvaluationService<P extends Product>
- Parameters:
comparisonNode
- A comparison node structure in a structured RSQL queryproduct
- The product to evaluate against- Returns:
- true if the product matches the criteria, false otherwise
-
evaluateRSQLExpression
public Boolean evaluateRSQLExpression(String selector, cz.jirutka.rsql.parser.ast.ComparisonOperator operator, List<String> arguments, P product) Description copied from interface:RSQLEvaluationService
Evaluated the expression against a product based on a set of comparison parameters.- Specified by:
evaluateRSQLExpression
in interfaceRSQLEvaluationService<P extends Product>
- Parameters:
selector
- The field on the productoperator
- The type of comparison (=,!=,lt,etc...)arguments
- One or more values to check against the fieldproduct
- The product to evaluate against- Returns:
- true if the product matches the criteria, false otherwise
-
handleNull
-
handleBetween
-
handleLessThanOrEqual
-
handleLessThan
-
handleGreaterThanOrEqual
-
handleGreaterThan
-
handleEqual
-
handleEqualIgnoreCase
-
handleIn
-
convertParsedRSQLToRegExpression
-