クラス ExpressionState
java.lang.ObjectSE
org.springframework.expression.spel.ExpressionState
ExpressionState は、式ごとの評価状態を維持するためのものです。それに対する変更は他の式からは見えませんが、ローカル変数を保持する場所と、複合式のコンポーネント式が状態を伝達する場所を提供します。これは、式の評価間で共有される EvaluationContext とは対照的であり、それに対する変更は、他の式またはコンテキストの質問をすることを選択したコードによって見られます。
また、さまざまな AST ノードが必要とする共通のユーティリティルーチンを定義する場所としても機能します。
- 導入:
- 3.0
- 作成者:
- Andy Clement, Juergen Hoeller, Sam Brannen
コンストラクターのサマリー
コンストラクター説明ExpressionState
(EvaluationContext context) ExpressionState
(EvaluationContext context, SpelParserConfiguration configuration) ExpressionState
(EvaluationContext context, TypedValue rootObject) ExpressionState
(EvaluationContext context, TypedValue rootObject, SpelParserConfiguration configuration) メソッドのサマリー
修飾子と型メソッド説明assignVariable
(StringSE name, SupplierSE<TypedValue> valueSupplier) 指定されたSupplier
SE によって作成された値を、評価コンテキスト内の名前付き変数に割り当てます。convertValue
(ObjectSE value, TypeDescriptor targetTypeDescriptor) convertValue
(TypedValue value, TypeDescriptor targetTypeDescriptor) void
void
enterScope
(StringSE name, ObjectSE value) void
enterScope
(MapSE<StringSE, ObjectSE> argMap) void
ClassSE<?>
アクティブなコンテキストオブジェクトは、プロパティなどへの修飾されていない参照が解決される対象です。lookupLocalVariable
(StringSE name) lookupVariable
(StringSE name) void
void
void
setLocalVariable
(StringSE name, ObjectSE value) void
setVariable
(StringSE name, ObjectSE value) 評価コンテキストの名前付き変数を指定された値に設定します。
コンストラクターの詳細
ExpressionState
ExpressionState
ExpressionState
ExpressionState
public ExpressionState(EvaluationContext context, TypedValue rootObject, SpelParserConfiguration configuration)
メソッドの詳細
getActiveContextObject
アクティブなコンテキストオブジェクトは、プロパティなどへの修飾されていない参照が解決される対象です。pushActiveContextObject
popActiveContextObject
public void popActiveContextObject()getRootContextObject
getScopeRootContextObject
assignVariable
指定されたSupplier
SE によって作成された値を、評価コンテキスト内の名前付き変数に割り当てます。setVariable(String, Object)
とは対照的に、このメソッドは、式内での割り当てをサポートするためにのみ呼び出す必要があります。- パラメーター:
name
- 割り当てる変数の名前valueSupplier
- 変数に割り当てられる値のサプライヤー- 戻り値:
- 割り当てられた値をラップする
TypedValue
- 導入:
- 5.2.24
- 関連事項:
setVariable
評価コンテキストの名前付き変数を指定された値に設定します。assignVariable(String, Supplier)
とは対照的に、このメソッドはプログラムでのみ呼び出す必要があります。- パラメーター:
name
- 設定する変数の名前value
- 変数に入れられる値- 関連事項:
lookupVariable
getTypeComparator
findType
convertValue
public ObjectSE convertValue(ObjectSE value, TypeDescriptor targetTypeDescriptor) throws EvaluationException getTypeConverter
convertValue
@Nullable public ObjectSE convertValue(TypedValue value, TypeDescriptor targetTypeDescriptor) throws EvaluationException enterScope
enterScope
public void enterScope()enterScope
exitScope
public void exitScope()setLocalVariable
lookupLocalVariable
operate
public TypedValue operate(Operation op, @Nullable ObjectSE left, @Nullable ObjectSE right) throws EvaluationException getPropertyAccessors
getEvaluationContext
getConfiguration