public class RSQLNodesFactory extends Object
Node instances for the parser.
If you want to define custom operators, then extend this class and
override createComparisonNode()
method.
| Constructor and Description |
|---|
RSQLNodesFactory() |
| Modifier and Type | Method and Description |
|---|---|
ComparisonNode |
createComparisonNode(String operator,
String selector,
List<String> arguments)
Creates a specific
ComparisonNode instance for the specified
operator and with the given selector and arguments. |
ComparisonNode |
createComparisonNode(String operator,
String selector,
String argument) |
LogicalNode |
createLogicalNode(LogicalOp operator,
List<Node> children)
Creates a specific
LogicalNode instance for the specified
operator and with the given children nodes. |
public LogicalNode createLogicalNode(LogicalOp operator, List<Node> children)
LogicalNode instance for the specified
operator and with the given children nodes.operator - The logical operator to create a node for.children - An arguments of the operation.LogicalNode according to the
specified operator.public ComparisonNode createComparisonNode(String operator, String selector, String argument) throws UnknownOperatorException
UnknownOperatorExceptioncreateComparisonNode(String, String, List)public ComparisonNode createComparisonNode(String operator, String selector, List<String> arguments) throws UnknownOperatorException
ComparisonNode instance for the specified
operator and with the given selector and arguments.
If you want to define a custom FIQL-like operators (i.e.
=[a-z]*=, ex.: =foo=), then override this method,
handle your custom operators at top and then call super to
handle the built-in operators.
operator - The comparison operator to create a node for.selector - The selector that specifies a left side of the comparison.arguments - A list of arguments that specifies a right side of the
comparison.ComparisonNode according to the
specified operator.UnknownOperatorExceptionCopyright © 2011–2014. All rights reserved.