org.openqa.selenium.support.pagefactory
Class DefaultFieldDecorator

java.lang.Object
  extended by org.openqa.selenium.support.pagefactory.DefaultFieldDecorator
All Implemented Interfaces:
FieldDecorator

public class DefaultFieldDecorator
extends java.lang.Object
implements FieldDecorator

Default decorator for use with PageFactory. Will decorate all of the WebElement fields with a proxy that locates the elements using the passed in ElementLocatorFactory.


Field Summary
protected  ElementLocatorFactory factory
           
 
Constructor Summary
DefaultFieldDecorator(ElementLocatorFactory factory)
           
 
Method Summary
 java.lang.Object decorate(java.lang.ClassLoader loader, java.lang.reflect.Field field)
          This method is called by PageFactory on all fields to decide how to decorate the field.
protected  WebElement proxyForLocator(java.lang.ClassLoader loader, ElementLocator locator, boolean renderedProxy)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factory

protected ElementLocatorFactory factory
Constructor Detail

DefaultFieldDecorator

public DefaultFieldDecorator(ElementLocatorFactory factory)
Method Detail

decorate

public java.lang.Object decorate(java.lang.ClassLoader loader,
                                 java.lang.reflect.Field field)
Description copied from interface: FieldDecorator
This method is called by PageFactory on all fields to decide how to decorate the field.

Specified by:
decorate in interface FieldDecorator
Parameters:
loader - The class loader that was used for the page object
field - The field that may be decorated.
Returns:
Value to decorate the field with or null if it shouldn't be decorated. If non-null, must be assignable to the field.

proxyForLocator

protected WebElement proxyForLocator(java.lang.ClassLoader loader,
                                     ElementLocator locator,
                                     boolean renderedProxy)


Copyright © 2011. All Rights Reserved.