Package org.springframework.context.expression

# Class MethodBasedEvaluationContext

java.lang.Object
org.springframework.expression.spel.support.StandardEvaluationContext
org.springframework.context.expression.MethodBasedEvaluationContext

All Implemented Interfaces:
  `org.springframework.expression.EvaluationContext`

public class MethodBasedEvaluationContext extends org.springframework.expression.spel.support.StandardEvaluationContext
A method-based `EvaluationContext` that provides explicit support for method-based invocations.

Expose the actual method arguments using the following aliases:

1. pX where X is the index of the argument (p0 for the first argument)
2. aX where X is the index of the argument (a1 for the second argument)
3. the name of the parameter as discovered by a configurable `ParameterNameDiscoverer`

Since:
  4.2
Author:
  Stephane Nicoll, Juergen Hoeller, Sebastien Deleuze

## Constructor Summary

Constructors
Constructor
Description
`MethodBasedEvaluationContext(Object rootObject, Method method, Object[] arguments, org.springframework.core.ParameterNameDiscoverer parameterNameDiscoverer)`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`lazyLoadArguments()`
Load the param information only when needed.
`Object`
`lookupVariable(String name)`

### Methods inherited from class org.springframework.expression.spel.support.StandardEvaluationContext

`addConstructorResolver, addIndexAccessor, addMethodResolver, addPropertyAccessor, applyDelegatesTo, getBeanResolver, getConstructorResolvers, getIndexAccessors, getMethodResolvers, getOperatorOverloader, getPropertyAccessors, getRootObject, getTypeComparator, getTypeConverter, getTypeLocator, registerFunction, registerFunction, registerMethodFilter, removeConstructorResolver, removeIndexAccessor, removeMethodResolver, removePropertyAccessor, setBeanResolver, setConstructorResolvers, setIndexAccessors, setMethodResolvers, setOperatorOverloader, setPropertyAccessors, setRootObject, setRootObject, setTypeComparator, setTypeConverter, setTypeLocator, setVariable, setVariables`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.springframework.expression.EvaluationContext

`assignVariable, isAssignmentEnabled`

## Constructor Details

### MethodBasedEvaluationContext

public MethodBasedEvaluationContext(Object rootObject, Method method, Object[] arguments, org.springframework.core.ParameterNameDiscoverer parameterNameDiscoverer)

## Method Details

### lookupVariable

@Nullable public Object lookupVariable(String name)

Specified by:
  `lookupVariable` in interface `org.springframework.expression.EvaluationContext`
Overrides:
  `lookupVariable` in class `org.springframework.expression.spel.support.StandardEvaluationContext`

### lazyLoadArguments

protected void lazyLoadArguments()
Load the param information only when needed.