Interface SpelNode

    • Method Detail

      • getTypedValue

        TypedValue getTypedValue​(ExpressionState expressionState)
                          throws EvaluationException
        Evaluate the expression node in the context of the supplied expression state and return the typed value.
        Parameters:
        expressionState - the current expression state (includes the context)
        Returns:
        the type value of this node evaluated against the specified state
        Throws:
        EvaluationException
      • isWritable

        boolean isWritable​(ExpressionState expressionState)
                    throws EvaluationException
        Determine if this expression node will support a setValue() call.
        Parameters:
        expressionState - the current expression state (includes the context)
        Returns:
        true if the expression node will allow setValue()
        Throws:
        EvaluationException - if something went wrong trying to determine if the node supports writing
      • setValue

        void setValue​(ExpressionState expressionState,
                      @Nullable
                      Object newValue)
               throws EvaluationException
        Evaluate the expression to a node and then set the new value on that node. For example, if the expression evaluates to a property reference, then the property will be set to the new value.
        Parameters:
        expressionState - the current expression state (includes the context)
        newValue - the new value
        Throws:
        EvaluationException - if any problem occurs evaluating the expression or setting the new value
      • toStringAST

        String toStringAST()
        Return the string form the this AST node.
        Returns:
        the string form
      • getChildCount

        int getChildCount()
        Return the number of children under this node.
        Returns:
        the child count
      • getChild

        SpelNode getChild​(int index)
        Helper method that returns a SpelNode rather than an Antlr Tree node.
        Returns:
        the child node cast to a SpelNode
      • getObjectClass

        @Nullable
        Class<?> getObjectClass​(@Nullable
                                Object obj)
        Determine the class of the object passed in, unless it is already a class object.
        Parameters:
        obj - the object that the caller wants the class of
        Returns:
        the class of the object if it is not already a class object, or null if the object is null
      • getStartPosition

        int getStartPosition()
        Return the start position of this AST node in the expression string.
        Returns:
        the start position
      • getEndPosition

        int getEndPosition()
        Return the end position of this AST node in the expression string.
        Returns:
        the end position