public interface

SpelNode

org.springframework.expression.spel.SpelNode
Known Indirect Subclasses

Class Overview

Represents a node in the Ast for a parsed expression.

Summary

Public Methods
abstract SpelNode getChild(int index)
Helper method that returns a SpelNode rather than an Antlr Tree node.
abstract int getChildCount()
abstract int getEndPosition()
abstract Class<?> getObjectClass(Object obj)
Determine the class of the object passed in, unless it is already a class object.
abstract int getStartPosition()
abstract TypedValue getTypedValue(ExpressionState expressionState)
Evaluate the expression node in the context of the supplied expression state and return the typed value.
abstract Object getValue(ExpressionState expressionState)
Evaluate the expression node in the context of the supplied expression state and return the value.
abstract boolean isWritable(ExpressionState expressionState)
Determine if this expression node will support a setValue() call.
abstract void setValue(ExpressionState expressionState, Object newValue)
Evaluate the expression to a node and then set the new value on that node.
abstract String toStringAST()

Public Methods

public abstract SpelNode getChild (int index)

Helper method that returns a SpelNode rather than an Antlr Tree node.

Returns
  • the child node cast to a SpelNode

public abstract int getChildCount ()

Returns
  • the number of children under this node

public abstract int getEndPosition ()

Returns
  • the end position of this Ast node in the expression string

public abstract Class<?> getObjectClass (Object obj)

Determine the class of the object passed in, unless it is already a class object.

Returns
  • the class of the object if it is not already a class object, or null if the object is null

public abstract int getStartPosition ()

Returns
  • the start position of this Ast node in the expression string

public abstract TypedValue getTypedValue (ExpressionState expressionState)

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

public abstract Object getValue (ExpressionState expressionState)

Evaluate the expression node in the context of the supplied expression state and return the value.

Parameters
expressionState the current expression state (includes the context)
Returns
  • the value of this node evaluated against the specified state

public abstract boolean isWritable (ExpressionState expressionState)

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

public abstract void setValue (ExpressionState expressionState, Object newValue)

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

public abstract String toStringAST ()

Returns
  • the string form of this AST node