Class HookDescriptor


  • public class HookDescriptor
    extends Object
    Describes a hook method to be called at instrumentation points.
    • Method Detail

      • getOwner

        public String getOwner()
        Returns:
        the owner class of the hook method (internal name, e.g. "com/example/Hooks")
      • getName

        public String getName()
        Returns:
        the name of the hook method
      • getDescriptor

        public String getDescriptor()
        Returns:
        the hook method descriptor
      • getInvokeType

        public InvokeType getInvokeType()
        Returns:
        the invocation type (typically STATIC)
      • isReplacesValue

        public boolean isReplacesValue()
        Returns:
        whether the hook's return value should replace the original value
      • staticHook

        public static HookDescriptor staticHook​(String owner,
                                                String name,
                                                String descriptor)
        Creates a descriptor for a static hook method.
        Parameters:
        owner - the hook class internal name
        name - the hook method name
        descriptor - the hook method descriptor
        Returns:
        the descriptor