Class AccessTarget.MethodCallTarget

All Implemented Interfaces:
HasDescription, CanBeAnnotated, HasName, HasName.AndFullName, HasOwner<JavaClass>, HasParameterTypes, HasReturnType, HasThrowsClause<AccessTarget.CodeUnitCallTarget>
Enclosing class:

public static final class AccessTarget.MethodCallTarget
extends AccessTarget.CodeUnitCallTarget
Represents a AccessTarget.CodeUnitCallTarget where the target is a method. For further elaboration about the necessity to distinguish MethodCallTarget from JavaMethod, refer to the documentation at AccessTarget and in particular the documentation at resolve().
  • Method Details

    • resolve

      @PublicAPI(usage=ACCESS) public java.util.Set<JavaMethod> resolve()
      Attempts to resolve imported methods that match this target. Note that while usually there is one unique target (if imported), it is possible that the call is ambiguous. For example consider
       interface A {
           void target();
       interface B {
           void target();
       interface C extends A, B {}
       class X {
           C c;
           // ...
           void origin() {
      While, for any concrete implementation, the compiler will naturally resolve one concrete target to link to, and thus at runtime the called target ist clear, from an analytical point of view the relevant target can't be uniquely identified here. To sum up, the result can be
      • empty - if no imported method matches the target
      • a single method - if the method was imported and can uniquely be identified
      • several methods - in scenarios where there is no unique method that matches the target
      Note that the target would be uniquely determinable, if C would declare void target() itself.
      Specified by:
      resolve in class AccessTarget.CodeUnitCallTarget
      Set of matching methods, usually a single target
      See Also:
      AccessTarget.ConstructorCallTarget.resolveConstructor(), resolve()
    • getDescription

      @PublicAPI(usage=ACCESS) public java.lang.String getDescription()