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 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 ObjectinvokeMethod(jakarta.el.ELContext context, Object base, Method method, Object @Nullable [] arguments) Invokes a method found on the base object, which is how the section 1.6 of the specification invokes a method expression that does not provide its own parameters.static @Nullable ObjectinvokeMethodExpression(jakarta.el.ELContext context, @Nullable Object target, @Nullable Object[] arguments) Invokes a method expression resolved from a single identifier, as described in the section 1.5.4 of the specification.static @Nullable ObjectinvokeWithParams(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object method, @Nullable Object[] params) Invokes a method of a base object with the parameters passed tojakarta.el.MethodExpression.invoke(ELContext, Object[]).static @Nullable ObjectinvokeWithParamTypes(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object method, Class<?> @Nullable [] paramTypes, @Nullable Object[] 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 @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
-
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, @Nullable Object[] 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
-
invokeWithParams
public static @Nullable Object invokeWithParams(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object method, @Nullable Object[] params) Invokes a method of a base object with the parameters passed tojakarta.el.MethodExpression.invoke(ELContext, Object[]).- Parameters:
context- The contextbase- The base objectmethod- The method nameparams- The parameters, can benull- 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, @Nullable Object[] 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
-
invokeMethod
public static @Nullable Object invokeMethod(jakarta.el.ELContext context, Object base, Method method, Object @Nullable [] arguments) Invokes a method found on the base object, which is how the section 1.6 of the specification invokes a method expression that does not provide its own parameters.- Parameters:
context- The contextbase- The base objectmethod- The methodarguments- 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
-
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
-