Once you get into code generation, the world is your oyster :-) Yeah, you could generate code that initialised the private fields from inside the class in a variety of ways - a new method, new code in the constructor, a new instance initialiser, etc.
But it definitely makes deployment a little harder (one extra build step), and code generation is not trivial. Regards, Noel Grandin Todd Volkert wrote: > This makes me wonder: does the JDK give us any hooks into the actual > compiler? Might we be able to compile in an instance initializer that > did the binding? >
