Ajocado Implementation 1.0.0.Alpha2

org.jboss.arquillian.ajocado.locator
Class XPathLocator

java.lang.Object
  extended by org.jboss.arquillian.ajocado.locator.AbstractLocator<T>
      extended by org.jboss.arquillian.ajocado.locator.AbstractElementLocator<XPathLocator>
          extended by org.jboss.arquillian.ajocado.locator.XPathLocator
All Implemented Interfaces:
CompoundableLocator<XPathLocator>, ElementLocator<XPathLocator>, ExtendedLocator<XPathLocator>, IterableLocator<XPathLocator>, Locator<XPathLocator>

public class XPathLocator
extends AbstractElementLocator<XPathLocator>
implements ExtendedLocator<XPathLocator>

Locates the element using XPath expression.

Version:
$Revision$
Author:
Lukas Fryc

Constructor Summary
XPathLocator(String xpath)
          Instantiates a new xpath locator.
 
Method Summary
 ExtendedLocator<XPathLocator> format(Object... args)
           
 Iterable<XPathLocator> getAllChildren()
           
 Iterable<XPathLocator> getAllOccurrences()
           
 XPathLocator getChild(XPathLocator elementLocator)
          Gets a child of this locator by composing this locator with given elementLocator.
 Iterable<XPathLocator> getChildren(XPathLocator elementLocator)
           
 XPathLocator getDescendant(XPathLocator elementLocator)
          Gets a descendant of this locator by composing this locator with given elementLocator.
 Iterable<XPathLocator> getDescendants(XPathLocator elementLocator)
           
 ElementLocationStrategy getLocationStrategy()
           
 XPathLocator getNthChildElement(int index)
           
 XPathLocator getNthOccurence(int index)
           
 
Methods inherited from class org.jboss.arquillian.ajocado.locator.AbstractElementLocator
getAttribute
 
Methods inherited from class org.jboss.arquillian.ajocado.locator.AbstractLocator
getAsString, getRawLocator, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.arquillian.ajocado.locator.ElementLocator
getAttribute
 
Methods inherited from interface org.jboss.arquillian.ajocado.locator.Locator
getAsString, getRawLocator
 

Constructor Detail

XPathLocator

public XPathLocator(String xpath)
Instantiates a new xpath locator.

Parameters:
xpath - the xpath
Method Detail

getLocationStrategy

public ElementLocationStrategy getLocationStrategy()
Specified by:
getLocationStrategy in interface ElementLocator<XPathLocator>
Specified by:
getLocationStrategy in interface Locator<XPathLocator>

getNthChildElement

public XPathLocator getNthChildElement(int index)
Specified by:
getNthChildElement in interface IterableLocator<XPathLocator>

getNthOccurence

public XPathLocator getNthOccurence(int index)
Specified by:
getNthOccurence in interface IterableLocator<XPathLocator>

getAllChildren

public Iterable<XPathLocator> getAllChildren()
Specified by:
getAllChildren in interface IterableLocator<XPathLocator>

getAllOccurrences

public Iterable<XPathLocator> getAllOccurrences()
Specified by:
getAllOccurrences in interface IterableLocator<XPathLocator>

getChildren

public Iterable<XPathLocator> getChildren(XPathLocator elementLocator)
Specified by:
getChildren in interface IterableLocator<XPathLocator>

getDescendants

public Iterable<XPathLocator> getDescendants(XPathLocator elementLocator)
Specified by:
getDescendants in interface IterableLocator<XPathLocator>

getChild

public XPathLocator getChild(XPathLocator elementLocator)
Description copied from interface: CompoundableLocator
Gets a child of this locator by composing this locator with given elementLocator.

Specified by:
getChild in interface CompoundableLocator<XPathLocator>
Parameters:
elementLocator - are added to this locator to compose new compount locator
Returns:
the composed locator for this locator with added elementLocator

getDescendant

public XPathLocator getDescendant(XPathLocator elementLocator)
Description copied from interface: CompoundableLocator
Gets a descendant of this locator by composing this locator with given elementLocator.

Specified by:
getDescendant in interface CompoundableLocator<XPathLocator>
Parameters:
elementLocator - are added to this locator to compose new compound locator
Returns:
the composed locator for this locator with added elementLocator

format

public ExtendedLocator<XPathLocator> format(Object... args)
Specified by:
format in interface ElementLocator<XPathLocator>
Specified by:
format in interface ExtendedLocator<XPathLocator>
Specified by:
format in interface Locator<XPathLocator>
Overrides:
format in class AbstractElementLocator<XPathLocator>

Ajocado Implementation 1.0.0.Alpha2

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.