Package org.fluentlenium.core.proxy
Class ComponentHandler
- java.lang.Object
-
- org.fluentlenium.core.proxy.AbstractLocatorHandler<org.openqa.selenium.WebElement>
-
- org.fluentlenium.core.proxy.ComponentHandler
-
- All Implemented Interfaces:
java.lang.reflect.InvocationHandler,LocatorHandler<org.openqa.selenium.WebElement>
public class ComponentHandler extends AbstractLocatorHandler<org.openqa.selenium.WebElement> implements java.lang.reflect.InvocationHandler, LocatorHandler<org.openqa.selenium.WebElement>
Proxy handler forWebElement.
-
-
Field Summary
-
Fields inherited from class org.fluentlenium.core.proxy.AbstractLocatorHandler
hookChainBuilder, hookDefinitions, hooks, locator, proxy, result
-
-
Constructor Summary
Constructors Constructor Description ComponentHandler(org.openqa.selenium.support.pagefactory.ElementLocator locator)Creates a new component handler
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.openqa.selenium.WebElementgetElement()Get the underlying element.org.openqa.selenium.WebElementgetInvocationTarget(java.lang.reflect.Method method)Retrieve the invocation target of this proxy handler.org.openqa.selenium.WebElementgetLocatorResultImpl()Get the actual result of the locator.java.lang.StringgetMessageContext()Retrieve the message context from this proxy locator.java.lang.Objectinvoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)protected booleanisStale()Get the stale status of the element.protected java.util.List<org.openqa.selenium.WebElement>resultToList(org.openqa.selenium.WebElement result)Convert result to a list of selenium element.-
Methods inherited from class org.fluentlenium.core.proxy.AbstractLocatorHandler
addListener, equals, fireProxyElementFound, fireProxyElementSearch, getHookLocator, getLazyToString, getLocator, getLocatorResult, getMethod, hashCode, loaded, noSuchElement, now, present, proxyToString, removeListener, reset, setHooks, setProxy, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.fluentlenium.core.proxy.LocatorHandler
addListener, getHookLocator, getLocator, getLocatorResult, loaded, noSuchElement, now, present, removeListener, reset, setHooks
-
-
-
-
Method Detail
-
getMessageContext
public java.lang.String getMessageContext()
Description copied from interface:LocatorHandlerRetrieve the message context from this proxy locator.- Specified by:
getMessageContextin interfaceLocatorHandler<org.openqa.selenium.WebElement>- Returns:
- message context
-
resultToList
protected java.util.List<org.openqa.selenium.WebElement> resultToList(org.openqa.selenium.WebElement result)
Description copied from class:AbstractLocatorHandlerConvert result to a list of selenium element.- Specified by:
resultToListin classAbstractLocatorHandler<org.openqa.selenium.WebElement>- Parameters:
result- found result- Returns:
- list of selenium element
-
isStale
protected boolean isStale()
Description copied from class:AbstractLocatorHandlerGet the stale status of the element.- Specified by:
isStalein classAbstractLocatorHandler<org.openqa.selenium.WebElement>- Returns:
- true if element is stale, false otherwise
-
getElement
public org.openqa.selenium.WebElement getElement()
Description copied from class:AbstractLocatorHandlerGet the underlying element.- Specified by:
getElementin classAbstractLocatorHandler<org.openqa.selenium.WebElement>- Returns:
- underlying element
-
getLocatorResultImpl
public org.openqa.selenium.WebElement getLocatorResultImpl()
Description copied from class:AbstractLocatorHandlerGet the actual result of the locator.- Specified by:
getLocatorResultImplin classAbstractLocatorHandler<org.openqa.selenium.WebElement>- Returns:
- result of the locator
-
getInvocationTarget
public org.openqa.selenium.WebElement getInvocationTarget(java.lang.reflect.Method method)
Description copied from interface:LocatorHandlerRetrieve the invocation target of this proxy handler.- Specified by:
getInvocationTargetin interfaceLocatorHandler<org.openqa.selenium.WebElement>- Parameters:
method- method to invoke- Returns:
- invocation target
-
invoke
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable- Specified by:
invokein interfacejava.lang.reflect.InvocationHandler- Overrides:
invokein classAbstractLocatorHandler<org.openqa.selenium.WebElement>- Throws:
java.lang.Throwable
-
-