Class ELResolution
java.lang.Object
io.micronaut.el.runtime.ELResolution
The resolution of identifiers, properties and methods described in the sections 1.5 and 1.6 of the
Jakarta Expression Language specification.
This class is invoked by the expressions generated at compilation time, it is not part of the public API of the module.
- Since:
- 1.0
- Author:
- Denis Stepanov
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable Objectaccess(jakarta.el.ELContext context, @Nullable Object base, ELLambdaBody.Unary access) Evaluates a property or method continuation only when its base is non-null.static @Nullable ObjectaccessRequired(jakarta.el.ELContext context, @Nullable Object base, ELLambdaBody.Unary access) Evaluates an lvalue continuation after requiring its base.static @Nullable ObjectassignIdentifier(jakarta.el.ELContext context, String name, @Nullable Object value) Assigns a value to an identifier and returns the assigned value, as described in the section 1.13 of the specification.static @Nullable ObjectassignProperty(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object property, @Nullable Object value) Assigns a value to a property and returns the assigned value, as described in the section 1.13 of the specification.static <T> TfunctionProvider(jakarta.el.ELContext context, Class<T> type) The instance a function declared on a bean is invoked on: the one registered in the context under its type, or the one theELBeanProviderregistered in the context returns.static @Nullable Class<?> getIdentifierType(jakarta.el.ELContext context, String name) static @Nullable Class<?> static @Nullable ObjectResolves a property of a base object, returningnullwhen the base or the property isnullas described for thegetValueevaluation of the section 1.6 of the specification.static @Nullable ObjectgetValueRequired(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object property) Resolves a property of a base object, failing when the base or the property isnull.static @Nullable Objectinvoke(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object method, Object... arguments) Invokes a method of a base object as described in the section 1.6 of the specification.static @Nullable ObjectinvokeCallable(jakarta.el.ELContext context, @Nullable Object target, Object... arguments) Invokes the result of a function expression as described in the section 1.5.2 of the specification, which covers the invocation of lambda expressions returning lambda expressions.static @Nullable ObjectinvokeMethodExpression(jakarta.el.ELContext context, @Nullable Object target, Object @Nullable [] arguments) Invokes a method expression resolved from a single identifier, as described in the section 1.5.4 of the specification.static @Nullable ObjectinvokeWithParamTypes(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object method, Class<?> @Nullable [] paramTypes, Object @Nullable [] params) Invokes a method of a base object with the parameter types provided when the expression was created, which is how the section 1.6 of the specification resolves an overloaded method.static booleanisIdentifierReadOnly(jakarta.el.ELContext context, String name) static booleanisReadOnly(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object property) static @Nullable ObjectlistElement(@Nullable List<?> list, @Nullable Object index) Reads an element of a list, as thejakarta.el.ListELResolverdoes for a base the compiler knows to be a list: the index is coerced to an integer, an index out of the bounds of the list reads as null, and so does a null base or index, section 1.6 of the specification.static @Nullable ObjectReads the value of a key of a map, as thejakarta.el.MapELResolverdoes for a base the compiler knows to be a map; a null base or key is null, section 1.6 of the specification.static ObjectnewInstance(jakarta.el.ELContext context, jakarta.el.ELClass elClass, Object... arguments) Invokes the constructor of an imported class as described in the section 1.24.3 of the specification.static voidrequireBase(@Nullable Object base) Requires the evaluated base of an lvalue to be non-null before its property or value is evaluated.static @Nullable ObjectresolveCallableIdentifier(jakarta.el.ELContext context, String name) Resolves an identifier used as a function, reporting a missing identifier as a missing function.static @Nullable ObjectresolveIdentifier(jakarta.el.ELContext context, String name) Evaluates an identifier as described in the section 1.5.1 of the specification.static @Nullable ObjectresolveStaticMember(jakarta.el.ELContext context, jakarta.el.ELClass base, String method) static @Nullable ObjectresolveVariable(jakarta.el.ELContext context, String name) Evaluates an identifier the compiler knows to be a declared variable: the steps of the section 1.5.1 of the specification that can denote a variable, a lambda argument of an enclosing scope, the variable mapper and the resolvers, without the static imports, which the compiler resolves itself.static voidsetIdentifier(jakarta.el.ELContext context, String name, @Nullable Object value) Assigns a value to an identifier, as used by the assignment operator.static voidsetValue(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object property, @Nullable Object value) Assigns a value to a property of a base object.
-
Method Details
-
resolveIdentifier
-
resolveVariable
Evaluates an identifier the compiler knows to be a declared variable: the steps of the section 1.5.1 of the specification that can denote a variable, a lambda argument of an enclosing scope, the variable mapper and the resolvers, without the static imports, which the compiler resolves itself.- Parameters:
context- The contextname- The identifier- Returns:
- The value of the variable
-
mapValue
Reads the value of a key of a map, as thejakarta.el.MapELResolverdoes for a base the compiler knows to be a map; a null base or key is null, section 1.6 of the specification.- Parameters:
map- The mapkey- The key- Returns:
- The value
-
listElement
Reads an element of a list, as thejakarta.el.ListELResolverdoes for a base the compiler knows to be a list: the index is coerced to an integer, an index out of the bounds of the list reads as null, and so does a null base or index, section 1.6 of the specification.- Parameters:
list- The listindex- The index- Returns:
- The element
-
setIdentifier
-
getIdentifierType
-
isIdentifierReadOnly
- Parameters:
context- The contextname- The identifier- Returns:
- True if the identifier is read only
-
getValue
public static @Nullable Object getValue(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object property) Resolves a property of a base object, returningnullwhen the base or the property isnullas described for thegetValueevaluation of the section 1.6 of the specification.- Parameters:
context- The contextbase- The base objectproperty- The property- Returns:
- The resolved value
-
access
public static @Nullable Object access(jakarta.el.ELContext context, @Nullable Object base, ELLambdaBody.Unary access) Evaluates a property or method continuation only when its base is non-null. Section 1.6 evaluates the base first and returnsnullwithout evaluating the property or parameters when the base is null. Generated expressions use this helper so statically resolved, direct member accesses retain that order without falling back to reflective resolution.- Parameters:
context- The contextbase- The evaluated baseaccess- The compiled continuation, receiving the non-null base- Returns:
- The result, or
nullfor a null base
-
accessRequired
public static @Nullable Object accessRequired(jakarta.el.ELContext context, @Nullable Object base, ELLambdaBody.Unary access) Evaluates an lvalue continuation after requiring its base. Assigning an lvalue with a null base fails before its property or assigned value is evaluated.- Parameters:
context- The contextbase- The evaluated baseaccess- The compiled continuation- Returns:
- The continuation result
-
requireBase
Requires the evaluated base of an lvalue to be non-null before its property or value is evaluated.- Parameters:
base- The evaluated base
-
getValueRequired
public static @Nullable Object getValueRequired(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object property) Resolves a property of a base object, failing when the base or the property isnull.- Parameters:
context- The contextbase- The base objectproperty- The property- Returns:
- The resolved value
-
setValue
-
getType
-
isReadOnly
-
assignIdentifier
public static @Nullable Object assignIdentifier(jakarta.el.ELContext context, String name, @Nullable Object value) Assigns a value to an identifier and returns the assigned value, as described in the section 1.13 of the specification.- Parameters:
context- The contextname- The identifiervalue- The value- Returns:
- The assigned value
-
assignProperty
public static @Nullable Object assignProperty(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object property, @Nullable Object value) Assigns a value to a property and returns the assigned value, as described in the section 1.13 of the specification.- Parameters:
context- The contextbase- The base objectproperty- The propertyvalue- The value- Returns:
- The assigned value
-
invokeMethodExpression
public static @Nullable Object invokeMethodExpression(jakarta.el.ELContext context, @Nullable Object target, Object @Nullable [] arguments) Invokes a method expression resolved from a single identifier, as described in the section 1.5.4 of the specification.- Parameters:
context- The contexttarget- The resolved identifierarguments- The arguments- Returns:
- The result of the invocation
-
invoke
public static @Nullable Object invoke(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object method, Object... arguments) Invokes a method of a base object as described in the section 1.6 of the specification.- Parameters:
context- The contextbase- The base objectmethod- The method namearguments- The arguments- Returns:
- The result of the invocation
-
invokeWithParamTypes
public static @Nullable Object invokeWithParamTypes(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object method, Class<?> @Nullable [] paramTypes, Object @Nullable [] params) Invokes a method of a base object with the parameter types provided when the expression was created, which is how the section 1.6 of the specification resolves an overloaded method.- Parameters:
context- The contextbase- The base objectmethod- The method nameparamTypes- The parameter types provided at parse time, can benullparams- The arguments- Returns:
- The result of the invocation
-
invokeCallable
public static @Nullable Object invokeCallable(jakarta.el.ELContext context, @Nullable Object target, Object... arguments) Invokes the result of a function expression as described in the section 1.5.2 of the specification, which covers the invocation of lambda expressions returning lambda expressions.- Parameters:
context- The contexttarget- The evaluated function namearguments- The arguments- Returns:
- The result of the invocation
-
resolveCallableIdentifier
-
newInstance
public static Object newInstance(jakarta.el.ELContext context, jakarta.el.ELClass elClass, Object... arguments) Invokes the constructor of an imported class as described in the section 1.24.3 of the specification.- Parameters:
context- The contextelClass- The classarguments- The arguments- Returns:
- The new instance
-
resolveStaticMember
-
functionProvider
The instance a function declared on a bean is invoked on: the one registered in the context under its type, or the one theELBeanProviderregistered in the context returns.- Type Parameters:
T- The type declaring the function- Parameters:
context- The contexttype- The type declaring the function- Returns:
- The instance
-