Top Description Fields Constructors Methods
org.springframework.expression.spel.ast

public Class InlineList

extends SpelNodeImpl
Class Inheritance
Imports
java.util.ArrayList, .Collections, .List, .StringJoiner, org.springframework.asm.MethodVisitor, org.springframework.expression.EvaluationException, .TypedValue, org.springframework.expression.spel.CodeFlow, .ExpressionState, .SpelNode, org.springframework.expression.spel.support.StandardEvaluationContext, org.springframework.lang.Nullable, org.springframework.util.Assert

Represent a list in an expression, e.g. '{1,2,3}'
Authors
Andy Clement, Sam Brannen, Harry Yang, Semyon Danilov
Since
3.0.4

Field Summary

Modifier and TypeField and Description
private final TypedValue
Inherited from org.springframework.expression.spel.ast.SpelNodeImpl:
childrenexitTypeDescriptor

Constructor Summary

AccessConstructor and Description
public
InlineList(int startPos, int endPos, SpelNodeImpl... args)

Method Summary

Modifier and TypeMethod and Description
private TypedValue
computeConstantValue()

If all the components of the list are constants, or lists that themselves contain constants, then a constant list can be built to represent this node.

pack-priv void
generateClinitCode(String clazzname, String constantFieldName, MethodVisitor mv, CodeFlow codeflow, boolean nested)

public void
generateCode(MethodVisitor
the ASM MethodVisitor into which code should be generated
mv
,
CodeFlow
a context object with info about what is on the stack
codeflow
)

Overrides org.springframework.expression.spel.ast.SpelNodeImpl.generateCode.

Generate the bytecode for this node into the supplied visitor.

public List<Object>
public TypedValue
public boolean
isCompilable()

Overrides org.springframework.expression.spel.ast.SpelNodeImpl.isCompilable.

Check whether a node can be compiled to bytecode.

public boolean
isConstant()

Return whether this list is a constant value.

public String
toStringAST()

Implements org.springframework.expression.spel.SpelNode.toStringAST.

Return the string form of this AST node.

Inherited from org.springframework.expression.spel.ast.SpelNodeImpl:
generateCodeForArgumentgenerateCodeForArgumentsgetChildgetChildCountgetEndPositiongetExitDescriptorgetObjectClassgetStartPositiongetTypedValuegetValuegetValuegetValueRefisWritablenextChildIssetValuesetValueInternal

Field Detail

constantback to summary
private final TypedValue constant
Annotations
@Nullable

Constructor Detail

InlineListback to summary
public InlineList(int startPos, int endPos, SpelNodeImpl... args)

Method Detail

computeConstantValueback to summary
private TypedValue computeConstantValue()

If all the components of the list are constants, or lists that themselves contain constants, then a constant list can be built to represent this node.

This will speed up later getValue calls and reduce the amount of garbage created.

Annotations
@Nullable
generateClinitCodeback to summary
pack-priv void generateClinitCode(String clazzname, String constantFieldName, MethodVisitor mv, CodeFlow codeflow, boolean nested)
generateCodeback to summary
public void generateCode(MethodVisitor mv, CodeFlow codeflow)

Overrides org.springframework.expression.spel.ast.SpelNodeImpl.generateCode.

Doc from org.springframework.expression.spel.ast.SpelNodeImpl.generateCode.

Generate the bytecode for this node into the supplied visitor. Context info about the current expression being compiled is available in the codeflow object, e.g. including information about the type of the object currently on the stack.

Parameters
mv:MethodVisitor

the ASM MethodVisitor into which code should be generated

codeflow:CodeFlow

a context object with info about what is on the stack

Annotations
@Override
getConstantValueback to summary
public List<Object> getConstantValue()
Annotations
@SuppressWarnings:unchecked
@Nullable
getValueInternalback to summary
public TypedValue getValueInternal(ExpressionState expressionState) throws EvaluationException

Implements abstract org.springframework.expression.spel.ast.SpelNodeImpl.getValueInternal.

Annotations
@Override
isCompilableback to summary
public boolean isCompilable()

Overrides org.springframework.expression.spel.ast.SpelNodeImpl.isCompilable.

Doc from org.springframework.expression.spel.ast.SpelNodeImpl.isCompilable.

Check whether a node can be compiled to bytecode. The reasoning in each node may be different but will typically involve checking whether the exit type descriptor of the node is known and any relevant child nodes are compilable.

Returns:boolean

true if this node can be compiled to bytecode

Annotations
@Override
isConstantback to summary
public boolean isConstant()

Return whether this list is a constant value.

toStringASTback to summary
public String toStringAST()

Implements org.springframework.expression.spel.SpelNode.toStringAST.

Doc from org.springframework.expression.spel.SpelNode.toStringAST.

Return the string form of this AST node.

Returns:String

the string form

Annotations
@Override