@Test(expected = NullPointerException.class) public void testCreateProxyWithNull() { BeanInterfaceProxy.createProxy(null); }
public static <T> T createProxy(final Class<T> proxyInterface) { if( proxyInterface == null ) { throw new NullPointerException("proxyInterface should not be null"); } return proxyInterface.cast(Proxy.newProxyInstance(proxyInterface.getClassLoader(), new Class[] { proxyInterface }, new BeanInterfaceProxy())); }
BeanInterfaceProxy implements InvocationHandler { public static <T> T createProxy(final Class<T> proxyInterface) { if( proxyInterface == null ) { throw new NullPointerException("proxyInterface should not be null"); } return proxyInterface.cast(Proxy.newProxyInstance(proxyInterface.getClassLoader(), new Class[] { proxyInterface }, new BeanInterfaceProxy())); } }
BeanInterfaceProxy implements InvocationHandler { public static <T> T createProxy(final Class<T> proxyInterface) { if( proxyInterface == null ) { throw new NullPointerException("proxyInterface should not be null"); } return proxyInterface.cast(Proxy.newProxyInstance(proxyInterface.getClassLoader(), new Class[] { proxyInterface }, new BeanInterfaceProxy())); } private  BeanInterfaceProxy(); }
BeanInterfaceProxy implements InvocationHandler { public static <T> T createProxy(final Class<T> proxyInterface) { if( proxyInterface == null ) { throw new NullPointerException("proxyInterface should not be null"); } return proxyInterface.cast(Proxy.newProxyInstance(proxyInterface.getClassLoader(), new Class[] { proxyInterface }, new BeanInterfaceProxy())); } private  BeanInterfaceProxy(); static T createProxy(final Class<T> proxyInterface); Object invoke(final Object proxy, final Method method, final Object[] args); }
BeanInterfaceProxy implements InvocationHandler { public static <T> T createProxy(final Class<T> proxyInterface) { if( proxyInterface == null ) { throw new NullPointerException("proxyInterface should not be null"); } return proxyInterface.cast(Proxy.newProxyInstance(proxyInterface.getClassLoader(), new Class[] { proxyInterface }, new BeanInterfaceProxy())); } private  BeanInterfaceProxy(); static T createProxy(final Class<T> proxyInterface); Object invoke(final Object proxy, final Method method, final Object[] args);  }