On Tue, Oct 12, 2010 at 23:59, Reinier Zwitserloot <[email protected]> wrote: > Rolling your own lombok plugin to produce builder pattern style stuff > is trivial.
132 columns and hard tabs? for serious? Well I dove in at HandleData and am now scratching around in HandleGetter. It's about as I expected, considering that it's manipulating a JavaC's private AST in Java. The obsession with returning booleans for everywhere confused me at first. For example, createGetterForField returns boolean, but in fact, in only ever returns true, which is good, since createGetterForFields completely ignores all the booleans returned by createGetterForField and just returns its own 'true', hard coded. Who needs that? Really, it's just about the public handle(...) method returning a boolean (a success value of some kind, I imagine), and your probably just trying to be consistent [1], since generateGetterForType actually can return false. [1] http://quotesnack.com/ralph-waldo-emerson/a-foolish-consistency-is-the-hobgoblin-of-little-minds-ralph-waldo-emerson/ ;-) In the meantime, I've managed to convince myself that I understand how createGetter() works, so, yea, it probably wouldn't be very difficult to implement my withX(x) builders for immutable types. Supporting a variant of @Data and @Setter to provide the OP's chainable setX methods would probably be even simpler. Yea, Lombok's a nice bit of work. // Ben -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
