public static < E > void rootElement ( WebElement root , E element ) { if ( element == null || root == null ) return ; if ( element instanceof WebElement ) return ; for ( Class < ? > clazz = element . getClass ( ) ; ! clazz . equals ( Object . class ) ; clazz = clazz . getSuperclass ( ) ) { if ( Enhancer . isEnhanced ( clazz ) ) continue ; Field [ ] fields = clazz . getDeclaredFields ( ) ; for ( Field field : fields ) { setRootElementField ( root , element , field ) ; } } }
Injects the root webelement into an element .