java.lang.Object
org.springframework.data.mongodb.core.spel.ExpressionNode
- All Implemented Interfaces:
Iterable<ExpressionNode>
- Direct Known Subclasses:
LiteralNode,MethodReferenceNode,NotOperatorNode,OperatorNode
A value object for nodes in an expression. Allows iterating ove potentially available child
ExpressionNodes.- Author:
- Oliver Gierke, Christoph Strobl, Mark Paluch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ExpressionNodeCreates a newExpressionNodefrom the givenSpelNode.static ExpressionNodefrom(SpelNode node, ExpressionState state) getChild(int index) Returns the childExpressionNodewith the given index.getName()Returns the name of theExpressionNode.getValue()Returns the value of the current node.booleanReturns whether the current node has child nodes.booleanhasfirstChildNotOfType(Class<?> type) Returns whether theExpressionNodehas a first child node that is not of the given type.booleanReturns whether theExpressionNodeis a literal.booleanReturns whether theExpressionNodeis a logical conjunction operation like&&, ||.booleanReturns whether theExpressionNodeis a mathematical operation.booleanReturns whether the currentExpressionNodeis backed by the given type.iterator()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ExpressionNode
- Parameters:
node- must not be null.state- must not be null.
-
-
Method Details
-
from
- Parameters:
node-state- must not be null.- Returns:
- an
ExpressionNodefor the givenSpelNodeor null if null was given for theSpelNode.
-
getName
Returns the name of theExpressionNode.- Returns:
-
isOfType
Returns whether the currentExpressionNodeis backed by the given type.- Parameters:
type- must not be null.- Returns:
-
isMathematicalOperation
public boolean isMathematicalOperation()Returns whether theExpressionNodeis a mathematical operation.- Returns:
-
isLogicalOperator
public boolean isLogicalOperator()Returns whether theExpressionNodeis a logical conjunction operation like&&, ||.- Returns:
- Since:
- 1.10
-
isLiteral
public boolean isLiteral()Returns whether theExpressionNodeis a literal.- Returns:
-
getValue
Returns the value of the current node.- Returns:
-
hasChildren
public boolean hasChildren()Returns whether the current node has child nodes.- Returns:
-
getChild
Returns the childExpressionNodewith the given index.- Parameters:
index- must not be negative.- Returns:
-
hasfirstChildNotOfType
Returns whether theExpressionNodehas a first child node that is not of the given type.- Parameters:
type- must not be null.- Returns:
-
from
Creates a newExpressionNodefrom the givenSpelNode.- Parameters:
node-- Returns:
-
iterator
- Specified by:
iteratorin interfaceIterable<ExpressionNode>
-