public class MethodExecutionInfo
extends java.lang.Object
| Constructor and Description |
|---|
MethodExecutionInfo(ClassPool programClassPool,
ClassPool libraryClassPool,
AnyMethodrefConstant anyMethodrefConstant,
CodeLocation caller,
Value... parameters)
Constructs a MethodExecutionInfo.
|
MethodExecutionInfo(@NotNull ClassPool programClassPool,
@NotNull ClassPool libraryClassPool,
@NotNull Clazz clazz,
@NotNull Method method,
@Nullable CodeLocation caller,
Value... parameters)
Constructs a MethodExecutionInfo.
|
MethodExecutionInfo(ClassPool programClassPool,
ClassPool libraryClassPool,
ConcreteCall call,
Value... parameters)
Constructs a MethodExecutionInfo.
|
| Modifier and Type | Method and Description |
|---|---|
@Nullable CodeLocation |
getCaller()
Get the code location of the call site.
|
@NotNull ReferenceValue |
getInstanceNonStatic()
Returns the calling instance value of the method, throws if the method is static.
|
@Nullable ReferenceValue |
getInstanceOrNullIfStatic()
Returns the calling instance value of the method, or null if the method is static.
|
java.util.Optional<java.lang.String> |
getInstanceType()
Get the type of the instance, or empty for static methods.
|
@NotNull ClassPool |
getLibraryClassPool() |
java.util.List<Value> |
getParameters()
Returns the parameters of the method, calling instance not included.
|
java.util.List<Clazz> |
getParametersClasses()
Returns the referenced
Clazz for each parameter. |
@NotNull ClassPool |
getProgramClassPool() |
MethodSignature |
getResolvedTargetSignature()
Gets the resolved target of the method call.
|
@Nullable Clazz |
getReturnClass()
Get the return class of the method.
|
java.lang.String |
getReturnType()
Get the static return type of the method.
|
MethodSignature |
getSignature()
Get the method signature of the method
|
@NotNull IdentifiedReferenceValue |
getSpecificInstance()
Returns the specific calling instance value of the method.
|
@NotNull Clazz |
getTargetClass()
Returns the referenced
Clazz of the target method. |
@NotNull java.lang.String |
getTargetType()
Get the static target type of the method.
|
boolean |
isConstructor()
Return whether the method is a constructor.
|
boolean |
isInstanceMethod() |
boolean |
isStatic()
Return whether the method is static.
|
boolean |
returnsSameTypeAsInstance()
Return whether the return and instance types of the method match.
|
boolean |
returnsVoid()
Whether the method returns void.
|
void |
setResolvedTargetSignature(@NotNull MethodSignature resolvedTargetSignature)
Sets the lazy property containing the resolved target of the method calls.
|
public MethodExecutionInfo(@NotNull
@NotNull ClassPool programClassPool,
@NotNull
@NotNull ClassPool libraryClassPool,
@NotNull
@NotNull Clazz clazz,
@NotNull
@NotNull Method method,
@Nullable
@Nullable CodeLocation caller,
@NotNull
Value... parameters)
programClassPool - The program class pool.libraryClassPool - The library class pool.clazz - The referenced class.method - The referenced method.caller - The code location of the call site. May be null.parameters - The parameters of the call, calling instance included.public MethodExecutionInfo(ClassPool programClassPool, ClassPool libraryClassPool, AnyMethodrefConstant anyMethodrefConstant, CodeLocation caller, Value... parameters)
anyMethodrefConstant - A method reference constant. Requires referenced class to be
initialized (using ClassReferenceInitializer).caller - The code location of the call site. May be null.parameters - The parameters of the call, calling instance included.public MethodExecutionInfo(ClassPool programClassPool, ClassPool libraryClassPool, ConcreteCall call, Value... parameters)
call - the concrete call.parameters - The parameters of the call, calling instance included.public MethodSignature getSignature()
@Nullable public @Nullable CodeLocation getCaller()
public boolean isConstructor()
public boolean isStatic()
public boolean isInstanceMethod()
@Nullable public @Nullable Clazz getReturnClass()
This is the return class as declared in the invoked method descriptor, method execution might provide a more specific runtime type.
public java.util.List<Clazz> getParametersClasses()
Clazz for each parameter.@NotNull public @NotNull Clazz getTargetClass()
Clazz of the target method. Corresponds to the invocation
instance class for instance methods and constructor calls.@NotNull public @NotNull java.lang.String getTargetType()
public java.lang.String getReturnType()
This is the return type as declared in the invoked method constructor, method execution might provide a more specific runtime type.
public java.util.Optional<java.lang.String> getInstanceType()
public boolean returnsSameTypeAsInstance()
public boolean returnsVoid()
@NotNull public @NotNull ReferenceValue getInstanceNonStatic()
@NotNull public @NotNull IdentifiedReferenceValue getSpecificInstance()
@Nullable public @Nullable ReferenceValue getInstanceOrNullIfStatic()
public java.util.List<Value> getParameters()
public MethodSignature getResolvedTargetSignature()
This property is lazily initialized and is guaranteed to be available while Executor.getMethodResult(MethodExecutionInfo, ValueCalculator) is running.
java.lang.IllegalStateException - if called before the initialization of the property.public void setResolvedTargetSignature(@NotNull
@NotNull MethodSignature resolvedTargetSignature)
@NotNull public @NotNull ClassPool getProgramClassPool()
@NotNull public @NotNull ClassPool getLibraryClassPool()