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 Details

    • name

      protected final String name
    • arguments

      protected final List<ExpressionNode> arguments
    • usedMethod

      protected io.micronaut.expressions.parser.ast.access.CandidateMethod usedMethod
  • Constructor Details

  • Method Details

    • doResolveType

      protected org.objectweb.asm.Type doResolveType(ExpressionVisitorContext ctx)
      Description copied from class: ExpressionNode
      Resolves expression AST node type.
      Specified by:
      doResolveType in class ExpressionNode
      Parameters:
      ctx - expression compilation context
      Returns:
      resolved type
    • doResolveClassElement

      protected ClassElement doResolveClassElement(ExpressionVisitorContext ctx)
      Description copied from class: ExpressionNode
      Resolves the class element for this node.
      Overrides:
      doResolveClassElement in class ExpressionNode
      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 single CandidateMethod 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 context
      methodElement - method element
      argumentTypes - types of arguments used for method invocation in expression
      Returns:
      candidate method
    • prepareVarargsArguments

      protected List<ExpressionNode> prepareVarargsArguments()
      This method wraps original method arguments into array for methods using varargs.
      Returns:
      list of arguments, including varargs arguments wrapped in array
    • resolveArgumentTypes

      protected List<org.objectweb.asm.Type> resolveArgumentTypes(ExpressionVisitorContext ctx)
      Resolve types of method invocation arguments.
      Parameters:
      ctx - expression evaluation context
      Returns:
      types of method arguments
    • compileArguments

      protected void compileArguments(ExpressionVisitorContext ctx)
      Compiles method arguments.
      Parameters:
      ctx - expression evaluation context
    • stringifyArguments

      protected String stringifyArguments(ExpressionVisitorContext ctx)
      Prepares arguments string for logging purposes.
      Parameters:
      ctx - expression compilation context
      Returns:
      arguments string