title: Can I make `new X()` in Java return a dynamic proxy?
body: <p>I know I can write a dynamic proxy like this:</p>
  
  <pre><code>public class DecoratedFile implements java.lang.reflect.InvocationHandler {
  
      private Object delegate;
  
      public static Object newInstance(Object delegate) {
          return java.lang.reflect.Proxy.newProxyInstance(
                obj.getClass().getClassLoader(),
                obj.getClass().getInterfaces(),
                new DecoratedFile (delegate));
      }
  
      private DecoratedFile (Object delegate) {
          this.obj = obj;
      }
  
      public Object invoke(Object proxy, Method m, Object[] args)
         throws Throwable
      {
          ... do something to `delegate`
      }
  }
  </code></pre>
  
  <p>... which can be instantiated like so:</p>
  
  <pre><code>  File decorated = DecoratedFile.newInstance(new File("README.txt"));
  </code></pre>
  
  <p>Is there a way to write a class such that I can instantiate a dynamic proxy using the "new" keyword:</p>
  
  <pre><code>  File decorated = new DecoratedFile(new File("README.txt"));
  </code></pre>
  
  <p>For example, to refactor a non-dynamic implementation without affecting its clients.</p>
  
  <p>If the answer is "no, you can't" -- is there a design principle behind this?</p>