Re: Annotation based library for equals,toString etc

2009-01-24 Thread Tim Lebedkov
Hello everybody, as announced I have created a project on the Google Code (http://code.google.com/p/jau/) and checked in some code. Version 0.5 Beta is ready for download Source Code: http://jau.googlecode.com/files/jau-0.5.zip JavaDoc: http://jau.googlecode.com/svn/trunk/JAU/doc/api/index.html A

Re: Annotation based library for equals,toString etc

2009-01-07 Thread Tim Lebedkov
Hello Martin, I have started the project at http://code.google.com/p/jau/. (I'll also unsubscribe myself from this list) Regards --Tim On Tue, Jan 6, 2009 at 8:11 PM, Martin Cooper wrote: > On Tue, Jan 6, 2009 at 5:41 AM, Tim Lebedkov wrote: > >> Hello dev@commons.apache.org reader, >> >> I wo

Re: Annotation based library for equals,toString etc

2009-01-06 Thread Martin Cooper
On Tue, Jan 6, 2009 at 5:41 AM, Tim Lebedkov wrote: > Hello dev@commons.apache.org reader, > > I would like to start a new project (in the sandbox?) for annotation > based implementation of methods like equals. > The idea is to annotate a class like this: > > @AutomaticEquals > class Test { >

Re: Annotation based library for equals,toString etc

2009-01-06 Thread Tim Lebedkov
Hello James, in my current code the allFields property of the @EqualsClass annotation controls whether all fields are automatically used, like this: // the simplest case @EqualsClass(allFields=true) private static final class OneField { public int value; } ...and addition

Re: Annotation based library for equals,toString etc

2009-01-06 Thread James Carman
I wouldn't think you'd want the AutomaticEquals stuff to be at the top-level, necessarily. Can you annotate property getters or perhaps the fields themselves? On Tue, Jan 6, 2009 at 10:59 AM, Tim Lebedkov wrote: > Hello Viraj, > > the first case (@XYZ) is how I thought about it (see also the tes

Re: Annotation based library for equals,toString etc

2009-01-06 Thread Tim Lebedkov
Hello Viraj, the first case (@XYZ) is how I thought about it (see also the test code in the attachment). This way .equals() could be implemented automatically. Of course you have to override the equals() method like this, if you would like it to behave "as designed": // maybe some sort of postpro

Re: Annotation based library for equals,toString etc

2009-01-06 Thread Viraj Turakhia
HI Tim, This project interests me. Would like to know more about it. Could you please explain this better? I am confused, what will I do if I want my class's objects to be compared using XYZ.equals();? Will I write it as: @XYZ public class MyClass{ ... ... ... } or @Annot(equals="XYZ" compareTo

Annotation based library for equals,toString etc

2009-01-06 Thread Tim Lebedkov
Hello dev@commons.apache.org reader, I would like to start a new project (in the sandbox?) for annotation based implementation of methods like equals. The idea is to annotate a class like this: @AutomaticEquals class Test { private int a; } and compare 2 instances of this class using Automat