title: How can I hide all java.lang.Object methods from code completion?
body: <p>i want to create some simple wrapper classes for an existing class library. To make the syntax nice to read AND nice to guess (via code completion) i'd like to remove the methods of <strong>java.lang.Object</strong>.</p>
  
  <p>The problem is that all non-atomic things in java inherit from Object and thus have these methods. I already tried to create the wrapper syntax via enums and interfaces, without success; because <strong>enums</strong> and <strong>interfaces</strong> are also <strong>java.lang.Objects</strong>.</p>
  
  <p>java.lang.Object has nine methods that i don't want to see in the code completion of my interfaces. Here's what i want to remove (red) and what i want to keep (green):</p>
  
  <p><a href="http://ju.venile.de/upload/java-lang-object-methods.png">alt text http://ju.venile.de/upload/java-lang-object-methods.png</a></p>
  
  <p>Here is some example code for creating nice wrappers around existing classes (Builder pattern):</p>
  
  <pre><code>public interface IMySyntax{
    public IMySyntax myMethod1();
    public IMySyntax myMethod2();
  }
  
  public class MyBuilder implements IMySyntax{
    public static IMySyntax build(){ return (IMySyntax) new MyBuilder() }
    public IMySyntax myMethod1(){ /* do something */ return (IMySyntax) this }
    public IMySyntax myMethod2(){ /* do something */ return (IMySyntax) this }     
  }
  </code></pre>
  
  <p>Usage of the new wrapper code should look like this:</p>
  
  <pre><code>MyBuilder.build()
           .myMethod1()
           .myMethod2();
  </code></pre>
  
  <p>Casting all <code>this</code> statements of the builder to an interface will reduce the method visibility, e.g. if the builder implements more that one interface. All java.lang.Object methods will stay, unfortunately.</p>
  
  <p>If this method hiding was possible in Java (maybe using Annotations?), i could create a nice library that is IDE agnostic (nice code completion everywhere). If not, than maybe there's a trick for at least the Eclipse IDE (maybe a plugin?) that can provide java.lang.Object method hiding.</p>