3

I'm working on another language compiler to java. In order for it to work correctly, I needed to generate some extra fields and methods, which need to be public so they can be accessed from anywhere.

Is there any way I can annotate a field to do not appear in auto-completion, so it doesn't clutter with useless (for the end-user) fields?

Something like System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never) on .NET (reference : Is it possible to hide a field (or just manipulate/hide from autocomplete) within its own class? )

Thank you!

Community
  • 1
  • 1
Waneck
  • 2,450
  • 1
  • 19
  • 31
  • May be too late but are you sure you really want to target Java and not JVM bytecode? Most modern JVM langauges target the JVM directly without going through the intermediate step of Java..... – mikera Feb 26 '12 at 03:14
  • The next step is to target bytecode : ) It's just easier to do that at first than to maybe get caught in unexpected errors with the bytecode at first. But even so, the question remains the same, since AFAIK eclipse can provide auto-completion from compiled JARS or .class files – Waneck Feb 26 '12 at 03:16
  • 2
    The `$` character is valid in identifiers, specifically for the purpose of autogenerated code (though it may now be reserved for inner classes, I don't know). I wonder if using it would have the effect you want. An annotation would be more to-the-point, of course. – Kevin Reid Feb 26 '12 at 03:24
  • Thanks, Kevin! It's worth a try. I'll try it right now – Waneck Feb 26 '12 at 03:52

0 Answers0