Interface ELMethod
- All Superinterfaces:
Serializable
ELMethodExecutor.
The descriptor contains the metadata exposed by MethodExpression and the invocation
itself. It deliberately has no java.lang.reflect dependency, so a service can implement it with a
generated dispatch method or any other direct invocation mechanism.
- Since:
- 1.1
- Author:
- Denis Stepanov
-
Method Summary
Modifier and TypeMethodDescriptiondefault io.micronaut.core.annotation.AnnotationMetadataReturns the method annotation metadata.io.micronaut.core.type.Argument<?>[]Returns the declared parameter types.getName()Returns the method name.io.micronaut.core.type.Argument<?> Returns the return type.default Stringidentity()Returns the identity used when an expression containing a bound function is compared with another one.static StringBuilds the identity of a method in the form the compiler gives it, so that an expression parsed at runtime compares equal to the same expression compiled at build time.@Nullable ObjectInvokes the method.default booleanWhether this method can be kept by the caller and invoked again.booleanReturns whether the method has a variable arity parameter.default Annotation[]Synthesizes the annotations required by the Jakarta EL method-reference API.
-
Method Details
-
getName
-
getReturnType
io.micronaut.core.type.Argument<?> getReturnType()Returns the return type.- Returns:
- The return type
-
getArguments
io.micronaut.core.type.Argument<?>[] getArguments()Returns the declared parameter types.- Returns:
- The declared parameter types
-
isVarArgs
boolean isVarArgs()Returns whether the method has a variable arity parameter.- Returns:
- Whether the method has a variable arity parameter
-
getAnnotationMetadata
default io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()Returns the method annotation metadata.- Returns:
- The method annotation metadata, or empty metadata when there is none
-
synthesizeAnnotations
Synthesizes the annotations required by the Jakarta EL method-reference API.- Returns:
- The method annotations
-
invoke
-
isReusable
default boolean isReusable()Whether this method can be kept by the caller and invoked again.A reusable method holds its signature and the code that runs it, and nothing of the call it was resolved for: the interpreter may then resolve a call site once and invoke the same method on every later evaluation, instead of resolving it again each time. A method that captured the arguments it was resolved with, or that only applies to their runtime types, is not reusable.
The default is
false, so an implementation is resolved again per call until it states otherwise. A method of an overloaded name is only reusable when the arguments cannot select a different overload.- Returns:
- Whether the method can be invoked again with other arguments
-
identity
Returns the identity used when an expression containing a bound function is compared with another one. Implementations with overloads should include the declaring type in the identity.- Returns:
- The method identity
- See Also:
-
identity
Builds the identity of a method in the form the compiler gives it, so that an expression parsed at runtime compares equal to the same expression compiled at build time.- Parameters:
declaringType- The type declaring the methodname- The name of the methodparameterTypes- The declared parameter types- Returns:
- The method identity
-