Class AbstractMethodCall
java.lang.Object
io.micronaut.expressions.parser.ast.ExpressionNode
io.micronaut.expressions.parser.ast.access.AbstractMethodCall
- Direct Known Subclasses:
ContextMethodCall
,ElementMethodCall
@Internal
public abstract sealed class AbstractMethodCall
extends ExpressionNode
permits ContextMethodCall, ElementMethodCall
Abstract expression AST node for method calls.
- Since:
- 4.0.0
- Author:
- Sergey Gavrilov
-
Field Summary
Modifier and TypeFieldDescriptionprotected final List<ExpressionNode>
protected final String
protected io.micronaut.expressions.parser.ast.access.CandidateMethod
Fields inherited from class io.micronaut.expressions.parser.ast.ExpressionNode
classElement, nodeType
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Compiles method arguments.protected ClassElement
Resolves the class element for this node.protected org.objectweb.asm.Type
Resolves expression AST node type.protected List<ExpressionNode>
This method wraps original method arguments into array for methods using varargs.protected List<org.objectweb.asm.Type>
Resolve types of method invocation arguments.protected abstract @NonNull io.micronaut.expressions.parser.ast.access.CandidateMethod
Resolves singleCandidateMethod
used by this AST node.protected String
Prepares arguments string for logging purposes.protected io.micronaut.expressions.parser.ast.access.CandidateMethod
toCandidateMethod
(ExpressionVisitorContext ctx, MethodElement methodElement, List<org.objectweb.asm.Type> argumentTypes) Builds candidate method for method element.Methods inherited from class io.micronaut.expressions.parser.ast.ExpressionNode
compile, generateBytecode, resolveClassElement, resolveType
-
Field Details
-
name
-
arguments
-
usedMethod
protected io.micronaut.expressions.parser.ast.access.CandidateMethod usedMethod
-
-
Constructor Details
-
AbstractMethodCall
-
-
Method Details
-
doResolveType
Description copied from class:ExpressionNode
Resolves expression AST node type.- Specified by:
doResolveType
in classExpressionNode
- Parameters:
ctx
- expression compilation context- Returns:
- resolved type
-
doResolveClassElement
Description copied from class:ExpressionNode
Resolves the class element for this node.- Overrides:
doResolveClassElement
in classExpressionNode
- Parameters:
ctx
- The expression compilation context- Returns:
- The resolved type
-
resolveUsedMethod
@NonNull protected abstract @NonNull io.micronaut.expressions.parser.ast.access.CandidateMethod resolveUsedMethod(ExpressionVisitorContext ctx) Resolves singleCandidateMethod
used by this AST node.- Parameters:
ctx
- Expression compilation context- Returns:
- AST node candidate method
- Throws:
ExpressionCompilationException
- if no candidate method can be found or if there is more than one candidate method.
-
toCandidateMethod
protected io.micronaut.expressions.parser.ast.access.CandidateMethod toCandidateMethod(ExpressionVisitorContext ctx, MethodElement methodElement, List<org.objectweb.asm.Type> argumentTypes) Builds candidate method for method element.- Parameters:
ctx
- expression compilation contextmethodElement
- method elementargumentTypes
- types of arguments used for method invocation in expression- Returns:
- candidate method
-
prepareVarargsArguments
This method wraps original method arguments into array for methods using varargs.- Returns:
- list of arguments, including varargs arguments wrapped in array
-
resolveArgumentTypes
Resolve types of method invocation arguments.- Parameters:
ctx
- expression evaluation context- Returns:
- types of method arguments
-
compileArguments
Compiles method arguments.- Parameters:
ctx
- expression evaluation context
-
stringifyArguments
Prepares arguments string for logging purposes.- Parameters:
ctx
- expression compilation context- Returns:
- arguments string
-