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
ConstructorsConstructorDescriptionDefaultRSQLEvaluationService(com.broadleafcommerce.data.tracking.core.filtering.fetch.rsql.RSQLArgumentParser argumentParser) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringevaluateRSQLExpression(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 BooleanhandleBetween(List<Object> parsed, Object property) protected BooleanhandleEqual(Object arg, boolean isString, boolean isRegex, Object property) protected BooleanhandleEqualIgnoreCase(Object arg, boolean isRegex, Object property) protected BooleanhandleGreaterThan(Object arg, Object property) protected BooleanhandleGreaterThanOrEqual(Object arg, Object property) protected BooleanhandleIn(Collection<?> arg, Object property) protected BooleanhandleLessThan(Object arg, Object property) protected BooleanhandleLessThanOrEqual(Object arg, Object property) protected BooleanhandleNull(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:RSQLEvaluationServiceEvaluated the expression against a product based on a genericNode.- Specified by:
evaluateRSQLExpressionin 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:RSQLEvaluationServiceEvaluated the expression against a product based on a logicalNode. Logical nodes are 'and'/'or' combinations of comparison nodes.- Specified by:
evaluateRSQLExpressionin 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:RSQLEvaluationServiceEvaluated the expression against a product based on a comparisonNode. Comparison nodes filter values on a specific field.- Specified by:
evaluateRSQLExpressionin 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:RSQLEvaluationServiceEvaluated the expression against a product based on a set of comparison parameters.- Specified by:
evaluateRSQLExpressionin 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
-