Interface IJavaCall

All Superinterfaces:
IJavaElement, IJavaExpression, IJavaStatement

@Ser public interface IJavaCall extends IJavaStatement, IJavaExpression
Java AST interface to represent a method invocation. This interface is not used to represent new-object or new-array creation.

Example:

 foo(0, 1, "bar")
 
See Also:
  • Field Details

  • Method Details

    • getMethod

      IJavaMethod getMethod()
      Get the method element.
      Returns:
      the method element
    • setMethod

      void setMethod(IJavaMethod method, int calltype)
      Set the method to be called.
      Parameters:
      method - mandatory method
      calltype - one of CALLTYPE_xxx constant
    • getCallType

      int getCallType()
      Returns:
    • isSuperCall

      boolean isSuperCall()
      Determine if the call is to a super-class method.
      Returns:
      true if the method being called is a super-class method
    • isLambdaCall

      boolean isLambdaCall()
      Returns:
    • isStaticCall

      boolean isStaticCall()
      Returns:
    • getMethodSignature

      String getMethodSignature()
      Get the original method jvm name (fully qualified canonical name).
      Returns:
    • getMethodClass

      String getMethodClass()
      Returns:
    • getMethodName

      String getMethodName()
      Get the original method simple name.
      Returns:
    • getArgumentCount

      int getArgumentCount()
      Get the number of arguments.
      Returns:
      the number of arguments
    • getArguments

      List<IJavaExpression> getArguments()
      Retrieve the list of arguments passed to the method.

      If the method being called is a virtual method, the first argument will be an expression representing the object on which this method is called.

      Returns:
      the list of arguments, the elements in the list cannot be null
    • getArgument

      IJavaExpression getArgument(int index)
      Parameters:
      index -
      Returns:
    • addArgument

      void addArgument(IJavaExpression arg)
      Append an argument to this method call.
      Parameters:
      arg -
    • insertArgument

      void insertArgument(int index, IJavaExpression arg)
      Insert an argument to the list of arguments.
      Parameters:
      index - 0-based argument index
      arg - mandatory argument to be inserted
    • setArgument

      void setArgument(int index, IJavaExpression arg)
      Parameters:
      index -
      arg -
    • removeArgument

      IJavaExpression removeArgument(int index)
      Pull an argument from the list of arguments.
      Parameters:
      index - 0-based argument index
      Returns:
      the argument object that was pulled out
    • duplicate

      IJavaCall duplicate()
      Description copied from interface: IJavaElement
      Duplicate this element.
      Specified by:
      duplicate in interface IJavaElement
      Specified by:
      duplicate in interface IJavaExpression
      Specified by:
      duplicate in interface IJavaStatement
      Returns:
      a (possibly) duplicated object of the same type