Class ArrayStoreHook

  • All Implemented Interfaces:
    Hook

    public class ArrayStoreHook
    extends Object
    implements Hook
    Configuration for array store instrumentation.
    • Method Detail

      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface Hook
        Returns:
        whether enabled
      • getPriority

        public int getPriority()
        Description copied from interface: Hook
        Gets the priority for ordering multiple hooks at the same point.
        Specified by:
        getPriority in interface Hook
        Returns:
        the priority
      • isPassArray

        public boolean isPassArray()
        Returns:
        whether the array reference is passed to the hook
      • isPassIndex

        public boolean isPassIndex()
        Returns:
        whether the array index is passed to the hook
      • isPassValue

        public boolean isPassValue()
        Returns:
        whether the stored value (boxed if primitive) is passed to the hook
      • isCanModifyValue

        public boolean isCanModifyValue()
        Returns:
        whether the hook can replace the stored value by returning a new one
      • getArrayTypeFilter

        public String getArrayTypeFilter()
        Returns:
        the array element type filter (e.g. "[Ljava/lang/Object;"), or null for no filter
      • simple

        public static ArrayStoreHook simple​(String hookOwner,
                                            String hookName,
                                            String hookDescriptor)
        Creates an array store hook that invokes the given static hook method.
        Parameters:
        hookOwner - the hook method's owning class (internal name)
        hookName - the hook method name
        hookDescriptor - the hook method descriptor
        Returns:
        the new hook
      • builder

        public static ArrayStoreHook.Builder builder()
        Creates a builder for an array store hook.
        Returns:
        a new builder