org.jboss.test.selenium.locator
Class DefaultAttributeLocator<E extends ElementLocator<E>>

java.lang.Object
  extended by org.jboss.test.selenium.locator.AbstractLocator<AttributeLocator<E>>
      extended by org.jboss.test.selenium.locator.DefaultAttributeLocator<E>
Type Parameters:
E - the type of associated element locator, which can be obtained from this attribute locator
All Implemented Interfaces:
AttributeLocator<E>, Locator<AttributeLocator<E>>

public class DefaultAttributeLocator<E extends ElementLocator<E>>
extends AbstractLocator<AttributeLocator<E>>
implements AttributeLocator<E>

Default implementation of locator for element's attributes.

Version:
$Revision$
Author:
Lukas Fryc

Constructor Summary
DefaultAttributeLocator(ElementLocator<E> elementLocator, Attribute attribute)
          Instantiates a attribute locator using given elementLocator and the specific attribute.
 
Method Summary
 AttributeLocator<E> format(Object... args)
           
 ElementLocator<E> getAssociatedElement()
          Returns the underlying element what associates attribute given by this locator to
 Attribute getAttribute()
          Returns the type of attribute which this locator points to.
 ElementLocationStrategy getLocationStrategy()
          Returns the location strategy for this element
 String getRawLocator()
          Returns the raw locator (without the prefix defining location strategy) representation.
 
Methods inherited from class org.jboss.test.selenium.locator.AbstractLocator
getAsString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.test.selenium.locator.Locator
getAsString
 

Constructor Detail

DefaultAttributeLocator

public DefaultAttributeLocator(ElementLocator<E> elementLocator,
                               Attribute attribute)
Instantiates a attribute locator using given elementLocator and the specific attribute.

Parameters:
elementLocator - the element locator
attribute - the attribute
Method Detail

getRawLocator

public String getRawLocator()
Description copied from interface: Locator
Returns the raw locator (without the prefix defining location strategy) representation.

Specified by:
getRawLocator in interface Locator<AttributeLocator<E extends ElementLocator<E>>>
Overrides:
getRawLocator in class AbstractLocator<AttributeLocator<E extends ElementLocator<E>>>
Returns:
the raw locator (without the prefix defining location strategy) representation.

getLocationStrategy

public ElementLocationStrategy getLocationStrategy()
Description copied from interface: Locator
Returns the location strategy for this element

Specified by:
getLocationStrategy in interface Locator<AttributeLocator<E extends ElementLocator<E>>>
Returns:
the location strategy for this element

getAssociatedElement

public ElementLocator<E> getAssociatedElement()
Description copied from interface: AttributeLocator
Returns the underlying element what associates attribute given by this locator to

Specified by:
getAssociatedElement in interface AttributeLocator<E extends ElementLocator<E>>
Returns:
the underlying element what associates attribute given by this locator to

getAttribute

public Attribute getAttribute()
Description copied from interface: AttributeLocator
Returns the type of attribute which this locator points to.

Specified by:
getAttribute in interface AttributeLocator<E extends ElementLocator<E>>
Returns:
the type of attribute which this locator points to.

format

public AttributeLocator<E> format(Object... args)
Specified by:
format in interface AttributeLocator<E extends ElementLocator<E>>
Specified by:
format in interface Locator<AttributeLocator<E extends ElementLocator<E>>>
Overrides:
format in class AbstractLocator<AttributeLocator<E extends ElementLocator<E>>>


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