Class StandardELContext
java.lang.Object
jakarta.el.ELContext
jakarta.el.StandardELContext
Standard implementation of
ELContext that provides a complete EL resolution environment. It maintains a
composite resolver chain, variable mapper, function mapper, and supports custom resolvers and local beans. This is
the default context implementation used by ELProcessor.- Since:
- EL 3.0
-
Constructor Summary
ConstructorsConstructorDescriptionStandardELContext(ELContext context) Constructs a new instance that wraps the given context.StandardELContext(ExpressionFactory factory) Constructs a new instance backed by the given expression factory. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddELResolver(ELResolver resolver) Adds a custom EL resolver to the resolver chain.getContext(Class<?> key) Obtain the context object for the given key.Returns the ELResolver used to resolve properties and method invocations during expression evaluation.Returns the FunctionMapper used to resolve EL function names to Java methods during expression evaluation.Returns the VariableMapper used to resolve EL variable names toValueExpressioninstances during expression evaluation.voidputContext(Class<?> key, Object contextObject) Add an object to this EL context under the given key.Methods inherited from class ELContext
addEvaluationListener, convertToType, enterLambdaScope, exitLambdaScope, getEvaluationListeners, getImportHandler, getLambdaArgument, getLocale, isLambdaArgument, isPropertyResolved, notifyAfterEvaluation, notifyBeforeEvaluation, notifyPropertyResolved, setLocale, setPropertyResolved, setPropertyResolved
-
Constructor Details
-
StandardELContext
Constructs a new instance backed by the given expression factory.Initializes the standard resolver chain with built-in resolvers and a function mapper populated from the factory's initial function map.
- Parameters:
factory- the expression factory providing the initial resolver and function configuration
-
StandardELContext
Constructs a new instance that wraps the given context.The variable mapper, function mapper, and EL resolver from the wrapped context are used, with additional standard resolvers prepended.
- Parameters:
context- the context to wrap
-
-
Method Details
-
putContext
Description copied from class:ELContextAdd an object to this EL context under the given key.- Overrides:
putContextin classELContext- Parameters:
key- The key under which to store the objectcontextObject- The object to add
-
getContext
Description copied from class:ELContextObtain the context object for the given key.- Overrides:
getContextin classELContext- Parameters:
key- The key of the required context object- Returns:
- The value of the context object associated with the given key
-
getELResolver
Description copied from class:ELContextReturns the ELResolver used to resolve properties and method invocations during expression evaluation.- Specified by:
getELResolverin classELContext- Returns:
- the ELResolver for this context
-
addELResolver
Adds a custom EL resolver to the resolver chain.Custom resolvers are inserted after the bean name resolver and before the standard resolvers, allowing them to intercept resolution before the built-in resolvers are consulted.
- Parameters:
resolver- the resolver to add
-
getFunctionMapper
Description copied from class:ELContextReturns the FunctionMapper used to resolve EL function names to Java methods during expression evaluation.- Specified by:
getFunctionMapperin classELContext- Returns:
- the FunctionMapper for this context
-
getVariableMapper
Description copied from class:ELContextReturns the VariableMapper used to resolve EL variable names toValueExpressioninstances during expression evaluation.- Specified by:
getVariableMapperin classELContext- Returns:
- the VariableMapper for this context
-