public abstract class

SpelNodeImpl

extends Object
implements SpelNode
java.lang.Object
   ↳ org.springframework.expression.spel.ast.SpelNodeImpl
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

The common supertype of all AST nodes in a parsed Spring Expression Language format expression.

Summary

Fields
protected SpelNodeImpl[] children
protected int pos
Public Constructors
SpelNodeImpl(int pos, SpelNodeImpl... operands)
Public Methods
SpelNode getChild(int index)
Helper method that returns a SpelNode rather than an Antlr Tree node.
int getChildCount()
int getEndPosition()
Class<?> getObjectClass(Object obj)
Determine the class of the object passed in, unless it is already a class object.
int getStartPosition()
final TypedValue getTypedValue(ExpressionState expressionState)
Evaluate the expression node in the context of the supplied expression state and return the typed value.
final Object getValue(ExpressionState expressionState)
Evaluate the expression node in the context of the supplied expression state and return the value.
abstract TypedValue getValueInternal(ExpressionState expressionState)
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.
abstract String toStringAST()
Protected Methods
SpelNodeImpl getPreviousChild()
final <T> T getValue(ExpressionState state, Class<T> desiredReturnType)
boolean nextChildIs(Class... clazzes)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.expression.spel.SpelNode

Fields

protected SpelNodeImpl[] children

protected int pos

Public Constructors

public SpelNodeImpl (int pos, SpelNodeImpl... operands)

Public Methods

public 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 int getChildCount ()

public int getEndPosition ()

public 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 int getStartPosition ()

public final 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 final 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 TypedValue getValueInternal (ExpressionState expressionState)

public 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()

public 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

public abstract String toStringAST ()

Protected Methods

protected SpelNodeImpl getPreviousChild ()

protected final T getValue (ExpressionState state, Class<T> desiredReturnType)

protected boolean nextChildIs (Class... clazzes)

Returns
  • true if the next child is one of the specified classes