Interface InvokePropertyMethodHook

  • All Superinterfaces:
    LifecycleHook
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @API(status=EXPERIMENTAL,
         since="1.6.0")
    @FunctionalInterface
    public interface InvokePropertyMethodHook
    extends LifecycleHook
    Implement this hook to override behaviour that invokes a method through reflection. Per default ReflectionSupport.invokeMethod(Method, Object, Object...) is called.

    Caveat: Only one hook per property method is possible.

    • Method Detail

      • invoke

        java.lang.Object invoke​(java.lang.reflect.Method method,
                                java.lang.Object target,
                                java.lang.Object... args)
                         throws java.lang.Throwable
        Invoke a method through some reflective mechanism. You may want to override the default call if invocation requires something special.
        Parameters:
        method - A method to be called
        target - An instance of the method's declaring class or null if it's a static method
        args - The arguments to user for method call
        Returns:
        any object
        Throws:
        java.lang.Throwable