public class CallUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
getSuperinterfaces(Clazz start,
java.util.Set<Clazz> accumulator)
Get the transitive superinterfaces of a class/interface recursively.
|
static java.util.Optional<java.lang.String> |
resolveFromSuperclasses(Clazz start,
java.lang.String name,
java.lang.String descriptor)
Search for the invocation target in a specific class and recursively in all superclasses.
|
static java.util.Set<java.lang.String> |
resolveFromSuperinterfaces(Clazz start,
java.lang.String name,
java.lang.String descriptor)
Search for a maximally specific default implementation in all superinterfaces of a class.
|
static java.util.Set<java.lang.String> |
resolveVirtual(Clazz callingClass,
Clazz thisPointerType,
AnyMethodrefConstant ref)
The
invokevirtual and invokeinterface resolution algorithm, annotated
with JVM
spec §6.5.invokevirtual citations where appropriate, so that the specified lookup process
can easily be compared to this implementation. |
static java.util.Set<java.lang.String> |
resolveVirtual(Clazz thisPointerType,
java.lang.String methodName,
java.lang.String descriptor)
The
invokevirtual and invokeinterface resolution algorithm, annotated
with JVM
spec §6.5.invokevirtual citations where appropriate, so that the specified lookup process
can easily be compared to this implementation. |
static java.util.Set<MethodSignature> |
resolveVirtualSignatures(Clazz thisPointerType,
java.lang.String methodName,
java.lang.String descriptor)
Adapter of
resolveVirtual(Clazz, String, String) returning MethodSignature . |
public static java.util.Set<java.lang.String> resolveVirtual(Clazz callingClass, Clazz thisPointerType, AnyMethodrefConstant ref)
invokevirtual
and invokeinterface
resolution algorithm, annotated
with JVM
spec §6.5.invokevirtual citations where appropriate, so that the specified lookup process
can easily be compared to this implementation.callingClass
- JVM spec: "current class".thisPointerType
- The type of the this
pointer of the call (JVM spec:
"objectref").ref
- The AnyMethodrefConstant
specifying name and descriptor of the method to be
invoked.resolveFromSuperinterfaces(Clazz, String, String)
for details on when there might
be multiple).public static java.util.Set<java.lang.String> resolveVirtual(Clazz thisPointerType, java.lang.String methodName, java.lang.String descriptor)
invokevirtual
and invokeinterface
resolution algorithm, annotated
with JVM
spec §6.5.invokevirtual citations where appropriate, so that the specified lookup process
can easily be compared to this implementation.thisPointerType
- The type of the this
pointer of the call (JVM spec:
"objectref").methodName
- The name of the invoked method.descriptor
- The descriptor of the invoked method.resolveFromSuperinterfaces(Clazz, String, String)
for details on when there might
be multiple).public static java.util.Set<MethodSignature> resolveVirtualSignatures(Clazz thisPointerType, java.lang.String methodName, java.lang.String descriptor)
resolveVirtual(Clazz, String, String)
returning MethodSignature
.thisPointerType
- The type of the this
pointer of the call (JVM spec:
"objectref").methodName
- The name of the invoked method.descriptor
- The descriptor of the invoked method.MethodSignature
s of potential call target (usually just one, but see resolveFromSuperinterfaces(Clazz, String, String)
for details on when there might be
multiple).public static java.util.Optional<java.lang.String> resolveFromSuperclasses(Clazz start, java.lang.String name, java.lang.String descriptor)
start
- The Clazz
where the lookup is to be started.name
- The name of the method.descriptor
- The method descriptor.Optional
with the fully qualified name of the class containing the target
method, empty if it couldn't be found.public static java.util.Set<java.lang.String> resolveFromSuperinterfaces(Clazz start, java.lang.String name, java.lang.String descriptor)
start
- The Clazz
whose superinterfaces are to be searched.name
- The target method name.descriptor
- The target method descriptor.public static void getSuperinterfaces(Clazz start, java.util.Set<Clazz> accumulator)
start
- The Clazz
where the collection process is to be started.accumulator
- The current set of superinterfaces, so that only one set is constructed at
runtime.