All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.appium.java_client.pagefactory.ProxyFactory Maven / Gradle / Ivy

There is a newer version: 9.4.0
Show newest version
package io.appium.java_client.pagefactory;


import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.MethodInterceptor;

/**
 * Original class is a super class of a 
 * proxy object here
 */
abstract class ProxyFactory {

	private ProxyFactory() {
		super();
	}
	
	@SuppressWarnings("unchecked")
	static  T getEnhancedProxy(Class requiredClazz, MethodInterceptor interceptor){
		Enhancer enhancer = new Enhancer();
		enhancer.setSuperclass(requiredClazz);
		enhancer.setCallback(interceptor);
		return (T) enhancer.create(new Class[] {}, new Object[] {});
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy