throw new NoSuchFieldException(fieldName+" is of type "+type+" and it's not an interface");
try {
final Object oldObject = f.get(mojo);
Object newObject = Proxy.newProxyInstance(type.getClassLoader(), new Class[]{type}, new InvocationHandler() {
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
return interceptor.invoke(proxy,method,args,new InvocationHandler() {
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
return method.invoke(oldObject,args);
}
});
}