Package org.fluentlenium.core.proxy
Class ComponentHandler
- java.lang.Object
-
- org.fluentlenium.core.proxy.AbstractLocatorHandler<T>
-
- org.fluentlenium.core.proxy.AbstractLocatorAndInvocationHandler<org.openqa.selenium.WebElement>
-
- org.fluentlenium.core.proxy.ComponentHandler
-
- All Implemented Interfaces:
InvocationHandler
,LocatorHandler<org.openqa.selenium.WebElement>
,LocatorStatusHandler
public class ComponentHandler extends AbstractLocatorAndInvocationHandler<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.WebElement
getElement()
Get the underlying element.org.openqa.selenium.WebElement
getInvocationTarget(Method method)
Retrieve the invocation target of this proxy handler.org.openqa.selenium.WebElement
getLocatorResultImpl()
Get the actual result of the locator.String
getMessageContext()
Retrieve the message context from this proxy locator.Object
invoke(Object proxy, Method method, Object[] args)
protected boolean
isStale()
Get the stale status of the element.protected 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.AbstractLocatorAndInvocationHandler
equals, hashCode, toString
-
Methods inherited from class org.fluentlenium.core.proxy.AbstractLocatorHandler
addListener, fireProxyElementFound, fireProxyElementSearch, getHookLocator, getLazyToString, getLocator, getLocatorResult, loaded, present, proxyToString, removeListener, reset, setHooks, setProxy
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.fluentlenium.core.proxy.LocatorHandler
noSuchElement, now
-
-
-
-
Method Detail
-
getMessageContext
public String getMessageContext()
Description copied from interface:LocatorHandler
Retrieve the message context from this proxy locator.- Returns:
- message context
-
resultToList
protected List<org.openqa.selenium.WebElement> resultToList(org.openqa.selenium.WebElement result)
Description copied from class:AbstractLocatorHandler
Convert result to a list of selenium element.- Specified by:
resultToList
in classAbstractLocatorHandler<org.openqa.selenium.WebElement>
- Parameters:
result
- found result- Returns:
- list of selenium element
-
isStale
protected boolean isStale()
Description copied from class:AbstractLocatorHandler
Get the stale status of the element.- Specified by:
isStale
in classAbstractLocatorHandler<org.openqa.selenium.WebElement>
- Returns:
- true if element is stale, false otherwise
-
getElement
public org.openqa.selenium.WebElement getElement()
Description copied from class:AbstractLocatorHandler
Get the underlying element.- Specified by:
getElement
in classAbstractLocatorHandler<org.openqa.selenium.WebElement>
- Returns:
- underlying element
-
getLocatorResultImpl
public org.openqa.selenium.WebElement getLocatorResultImpl()
Description copied from class:AbstractLocatorHandler
Get the actual result of the locator.- Specified by:
getLocatorResultImpl
in classAbstractLocatorHandler<org.openqa.selenium.WebElement>
- Returns:
- result of the locator
-
getInvocationTarget
public org.openqa.selenium.WebElement getInvocationTarget(Method method)
Description copied from interface:LocatorHandler
Retrieve the invocation target of this proxy handler.- Parameters:
method
- method to invoke- Returns:
- invocation target
-
invoke
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- Specified by:
invoke
in interfaceInvocationHandler
- Overrides:
invoke
in classAbstractLocatorAndInvocationHandler<org.openqa.selenium.WebElement>
- Throws:
Throwable
-
-