Interface LocatorHandler<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean addListener​(ProxyElementListener listener)
      Add a listener for this locator handler.
      org.openqa.selenium.support.pagefactory.ElementLocator getHookLocator()
      Retrieve the element locator used by this proxy, with hooks applied.
      T getInvocationTarget​(java.lang.reflect.Method method)
      Retrieve the invocation target of this proxy handler.
      org.openqa.selenium.support.pagefactory.ElementLocator getLocator()
      Retrieve the element locator used by this proxy, without any hook applied.
      T getLocatorResult()
      Get the result retrieved by the element locator, without any hook applied.
      java.lang.String getMessageContext()
      Retrieve the message context from this proxy locator.
      boolean loaded()
      Check if this handler has loaded it's result.
      org.openqa.selenium.NoSuchElementException noSuchElement()
      Build a NoSuchElementException with message from this locator.
      void now()
      If result is not loaded, load result immediately.
      boolean present()
      Check if the result is present.
      boolean removeListener​(ProxyElementListener listener)
      Removes a proxy element listener.
      void reset()
      Reset the loaded data.
      void setHooks​(HookChainBuilder hookChainBuilder, java.util.List<HookDefinition<?>> hookDefinitions)
      Apply this hook list.
    • Method Detail

      • getLocator

        org.openqa.selenium.support.pagefactory.ElementLocator getLocator()
        Retrieve the element locator used by this proxy, without any hook applied.
        Returns:
        element locator
      • getLocatorResult

        T getLocatorResult()
        Get the result retrieved by the element locator, without any hook applied.
        Returns:
        results of the element locator
      • getHookLocator

        org.openqa.selenium.support.pagefactory.ElementLocator getHookLocator()
        Retrieve the element locator used by this proxy, with hooks applied.
        Returns:
        element locator wrapped with hooks
      • getInvocationTarget

        T getInvocationTarget​(java.lang.reflect.Method method)
        Retrieve the invocation target of this proxy handler.
        Parameters:
        method - method to invoke
        Returns:
        invocation target
      • setHooks

        void setHooks​(HookChainBuilder hookChainBuilder,
                      java.util.List<HookDefinition<?>> hookDefinitions)
        Apply this hook list.
        Parameters:
        hookChainBuilder - hook chain builder
        hookDefinitions - hook definitions
      • loaded

        boolean loaded()
        Check if this handler has loaded it's result.
        Returns:
        true if the result is loaded, false otherwise
      • reset

        void reset()
        Reset the loaded data.
      • now

        void now()
        If result is not loaded, load result immediately. If it's already loaded, it has no effect.
      • present

        boolean present()
        Check if the result is present.
        Returns:
        true if result is present, false otherwise
      • addListener

        boolean addListener​(ProxyElementListener listener)
        Add a listener for this locator handler.
        Parameters:
        listener - listener to add, which will be notified when result is searched and found
        Returns:
        true if the listener was added, false otherwise
      • removeListener

        boolean removeListener​(ProxyElementListener listener)
        Removes a proxy element listener.
        Parameters:
        listener - listener to remove
        Returns:
        true if the listener was removed, false otherwise
      • noSuchElement

        org.openqa.selenium.NoSuchElementException noSuchElement()
        Build a NoSuchElementException with message from this locator.
        Returns:
        Exception with not present message
      • getMessageContext

        java.lang.String getMessageContext()
        Retrieve the message context from this proxy locator.
        Returns:
        message context