Class WidgetInterceptor

    • Constructor Summary

      Constructors 
      Constructor Description
      WidgetInterceptor​(CacheableLocator locator, java.lang.ref.WeakReference<org.openqa.selenium.WebDriver> driverReference, java.lang.ref.WeakReference<org.openqa.selenium.WebElement> cachedElementReference, java.util.Map<ContentType,​java.lang.reflect.Constructor<? extends Widget>> instantiationMap, java.time.Duration duration)
      Proxy interceptor class for widgets.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object call​(java.lang.Object obj, java.lang.reflect.Method method, java.lang.Object[] args, java.util.concurrent.Callable<?> original)
      Override this callback in order to change/customize the behavior of a single or multiple methods.
      protected java.lang.Object getObject​(org.openqa.selenium.WebElement element, java.lang.reflect.Method method, java.lang.Object[] args)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WidgetInterceptor

        public WidgetInterceptor​(@Nullable
                                 CacheableLocator locator,
                                 java.lang.ref.WeakReference<org.openqa.selenium.WebDriver> driverReference,
                                 @Nullable
                                 java.lang.ref.WeakReference<org.openqa.selenium.WebElement> cachedElementReference,
                                 java.util.Map<ContentType,​java.lang.reflect.Constructor<? extends Widget>> instantiationMap,
                                 java.time.Duration duration)
        Proxy interceptor class for widgets.
    • Method Detail

      • getObject

        protected java.lang.Object getObject​(org.openqa.selenium.WebElement element,
                                             java.lang.reflect.Method method,
                                             java.lang.Object[] args)
                                      throws java.lang.Throwable
        Specified by:
        getObject in class InterceptorOfASingleElement
        Throws:
        java.lang.Throwable
      • call

        public java.lang.Object call​(java.lang.Object obj,
                                     java.lang.reflect.Method method,
                                     java.lang.Object[] args,
                                     java.util.concurrent.Callable<?> original)
                              throws java.lang.Throwable
        Description copied from interface: MethodCallListener
        Override this callback in order to change/customize the behavior of a single or multiple methods. The original method result will be replaced with the result returned by this callback. Also, any exception thrown by it will replace original method(s) exception.
        Specified by:
        call in interface MethodCallListener
        Overrides:
        call in class InterceptorOfASingleElement
        Parameters:
        obj - The proxy instance
        method - Method to be replaced
        args - Array of method arguments
        original - The reference to the original method in case it is necessary to instrument its result.
        Returns:
        The type of the returned result should be castable to the returned type of the original method.
        Throws:
        java.lang.Throwable