Package org.fluentlenium.core.proxy
Class ListHandler
- java.lang.Object
-
- org.fluentlenium.core.proxy.AbstractLocatorHandler<java.util.List<org.openqa.selenium.WebElement>>
-
- org.fluentlenium.core.proxy.ListHandler
-
- All Implemented Interfaces:
java.lang.reflect.InvocationHandler
,LocatorHandler<java.util.List<org.openqa.selenium.WebElement>>
public class ListHandler extends AbstractLocatorHandler<java.util.List<org.openqa.selenium.WebElement>>
Proxy handler for list ofWebElement
.
-
-
Field Summary
-
Fields inherited from class org.fluentlenium.core.proxy.AbstractLocatorHandler
hookChainBuilder, hookDefinitions, hooks, locator, proxy, result
-
-
Constructor Summary
Constructors Constructor Description ListHandler(org.openqa.selenium.support.pagefactory.ElementLocator locator)
Creates a new proxy handler for elements.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.openqa.selenium.WebElement
getElement()
Get the underlying element.java.util.List<org.openqa.selenium.WebElement>
getInvocationTarget(java.lang.reflect.Method method)
Retrieve the invocation target of this proxy handler.protected java.lang.String
getLazyToString()
Get string representation of not already found element.java.util.List<org.openqa.selenium.WebElement>
getLocatorResultImpl()
Get the actual result of the locator.java.lang.String
getMessageContext()
Retrieve the message context from this proxy locator.java.lang.Object
invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
protected boolean
isStale()
Get the stale status of the element.boolean
present()
Check if the result is present.protected java.util.List<org.openqa.selenium.WebElement>
resultToList(java.util.List<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, getLocator, getLocatorResult, getMethod, hashCode, loaded, noSuchElement, now, proxyToString, removeListener, reset, setHooks, setProxy, toString
-
-
-
-
Method Detail
-
getMessageContext
public java.lang.String getMessageContext()
Description copied from interface:LocatorHandler
Retrieve the message context from this proxy locator.- Returns:
- message context
-
resultToList
protected java.util.List<org.openqa.selenium.WebElement> resultToList(java.util.List<org.openqa.selenium.WebElement> result)
Description copied from class:AbstractLocatorHandler
Convert result to a list of selenium element.- Specified by:
resultToList
in classAbstractLocatorHandler<java.util.List<org.openqa.selenium.WebElement>>
- Parameters:
result
- found result- Returns:
- list of selenium element
-
getElement
protected org.openqa.selenium.WebElement getElement()
Description copied from class:AbstractLocatorHandler
Get the underlying element.- Specified by:
getElement
in classAbstractLocatorHandler<java.util.List<org.openqa.selenium.WebElement>>
- Returns:
- underlying element
-
getInvocationTarget
public java.util.List<org.openqa.selenium.WebElement> getInvocationTarget(java.lang.reflect.Method method)
Description copied from interface:LocatorHandler
Retrieve the invocation target of this proxy handler.- Parameters:
method
- method to invoke- Returns:
- invocation target
-
present
public boolean present()
Description copied from interface:LocatorHandler
Check if the result is present.- Specified by:
present
in interfaceLocatorHandler<java.util.List<org.openqa.selenium.WebElement>>
- Overrides:
present
in classAbstractLocatorHandler<java.util.List<org.openqa.selenium.WebElement>>
- Returns:
- true if result is present, false otherwise
-
isStale
protected boolean isStale()
Description copied from class:AbstractLocatorHandler
Get the stale status of the element.- Specified by:
isStale
in classAbstractLocatorHandler<java.util.List<org.openqa.selenium.WebElement>>
- Returns:
- true if element is stale, false otherwise
-
getLocatorResultImpl
public java.util.List<org.openqa.selenium.WebElement> getLocatorResultImpl()
Description copied from class:AbstractLocatorHandler
Get the actual result of the locator.- Specified by:
getLocatorResultImpl
in classAbstractLocatorHandler<java.util.List<org.openqa.selenium.WebElement>>
- Returns:
- result of the locator
-
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:
invoke
in interfacejava.lang.reflect.InvocationHandler
- Overrides:
invoke
in classAbstractLocatorHandler<java.util.List<org.openqa.selenium.WebElement>>
- Throws:
java.lang.Throwable
-
getLazyToString
protected java.lang.String getLazyToString()
Description copied from class:AbstractLocatorHandler
Get string representation of not already found element.- Overrides:
getLazyToString
in classAbstractLocatorHandler<java.util.List<org.openqa.selenium.WebElement>>
- Returns:
- string representation of not already found element
-
-