接口 SpelNode

所有已知实现类:
Assign, BeanReference, BooleanLiteral, CompoundExpression, ConstructorReference, Elvis, FloatLiteral, FunctionReference, Identifier, Indexer, InlineList, InlineMap, IntLiteral, Literal, LongLiteral, MethodReference, NullLiteral, OpAnd, OpDec, OpDivide, OpEQ, Operator, OperatorBetween, OperatorInstanceof, OperatorMatches, OperatorNot, OperatorPower, OpGE, OpGT, OpInc, OpLE, OpLT, OpMinus, OpModulus, OpMultiply, OpNE, OpOr, OpPlus, Projection, PropertyOrFieldReference, QualifiedIdentifier, RealLiteral, Selection, SpelNodeImpl, StringLiteral, Ternary, TypeReference, VariableReference

public interface SpelNode
Represents a node in the AST for a parsed expression.
从以下版本开始:
4.0
作者:
Andy Clement
  • 方法概要

    修饰符和类型
    方法
    说明
    getChild(int index)
    Helper method that returns a SpelNode rather than an Antlr Tree node.
    int
    Return the number of children under this node.
    int
    Return the end position of this AST node in the expression string.
    Determine the class of the object passed in, unless it is already a class object.
    int
    Return the start position of this AST node in the expression string.
    getTypedValue(ExpressionState expressionState)
    Evaluate the expression node in the context of the supplied expression state and return the typed value.
    getValue(ExpressionState expressionState)
    Evaluate the expression node in the context of the supplied expression state and return the value.
    boolean
    isWritable(ExpressionState expressionState)
    Determine if this expression node will support a setValue() call.
    void
    setValue(ExpressionState expressionState, Object newValue)
    Evaluate the expression to a node and then set the new value on that node.
    Return the string form the this AST node.
  • 方法详细资料

    • getValue

      @Nullable Object getValue(ExpressionState expressionState) throws EvaluationException
      Evaluate the expression node in the context of the supplied expression state and return the value.
      参数:
      expressionState - the current expression state (includes the context)
      返回:
      the value of this node evaluated against the specified state
      抛出:
      EvaluationException
    • getTypedValue

      TypedValue getTypedValue(ExpressionState expressionState) throws EvaluationException
      Evaluate the expression node in the context of the supplied expression state and return the typed value.
      参数:
      expressionState - the current expression state (includes the context)
      返回:
      the type value of this node evaluated against the specified state
      抛出:
      EvaluationException
    • isWritable

      boolean isWritable(ExpressionState expressionState) throws EvaluationException
      Determine if this expression node will support a setValue() call.
      参数:
      expressionState - the current expression state (includes the context)
      返回:
      true if the expression node will allow setValue()
      抛出:
      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.
      参数:
      expressionState - the current expression state (includes the context)
      newValue - the new value
      抛出:
      EvaluationException - if any problem occurs evaluating the expression or setting the new value
    • toStringAST

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

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

      SpelNode getChild(int index)
      Helper method that returns a SpelNode rather than an Antlr Tree node.
      返回:
      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.
      参数:
      obj - the object that the caller wants the class of
      返回:
      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.
      返回:
      the start position
    • getEndPosition

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