@Immutable
public class NodesFactory
extends java.lang.Object
Node instances for the parser.| Constructor and Description |
|---|
NodesFactory(java.util.Set<ComparisonOperator> operators)
Creates a new instance of
NodesFactory with given supported operators. |
| Modifier and Type | Method and Description |
|---|---|
ComparisonNode |
createComparisonNode(java.lang.String operatorToken,
java.lang.String selector,
java.util.List<java.lang.String> arguments)
Creates a
ComparisonNode instance with the given parameters. |
LogicalNode |
createLogicalNode(LogicalOperator operator,
java.util.List<Node> children)
Creates a specific
LogicalNode instance for the specified operator and with the given children nodes. |
public NodesFactory(java.util.Set<ComparisonOperator> operators)
NodesFactory with given supported operators.operators - The supported operators. Must not be null or empty.java.lang.IllegalArgumentException - If operators is null or empty. If operator's primary symbol is
equal to one of alternative symbols of other operator.public LogicalNode createLogicalNode(LogicalOperator operator, java.util.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 - Children nodes, i.e. operands.LogicalNode according to the specified operator.public ComparisonNode createComparisonNode(java.lang.String operatorToken, java.lang.String selector, java.util.List<java.lang.String> arguments) throws UnknownOperatorException
ComparisonNode instance with the given parameters.operatorToken - A textual representation of the comparison operator to be found in the set of supported
operators.selector - The selector that specifies the left side of the comparison.arguments - A list of arguments that specifies the right side of the comparison.ComparisonNode instance with the given parameters.UnknownOperatorException - If no operator for the specified operator token exists.