Class WidgetInterceptor
- java.lang.Object
-
- io.appium.java_client.pagefactory.interceptors.InterceptorOfASingleElement
-
- io.appium.java_client.pagefactory.WidgetInterceptor
-
- All Implemented Interfaces:
MethodCallListener
public class WidgetInterceptor extends InterceptorOfASingleElement
-
-
Field Summary
-
Fields inherited from class io.appium.java_client.pagefactory.interceptors.InterceptorOfASingleElement
locator
-
Fields inherited from interface io.appium.java_client.proxy.MethodCallListener
UNSET
-
-
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
-
Methods inherited from interface io.appium.java_client.proxy.MethodCallListener
afterCall, beforeCall, onError
-
-
-
-
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 classInterceptorOfASingleElement
- 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 interfaceMethodCallListener
- Overrides:
call
in classInterceptorOfASingleElement
- Parameters:
obj
- The proxy instancemethod
- Method to be replacedargs
- Array of method argumentsoriginal
- 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
-
-