Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Marker Annotations

I've been using AspectJ a bit and I've got a question that is way outside
of my experience and was wondering if someone could help.

I would like to use a Market Annotation on fields in a class to generate
an equals method. Something like:

public class Rubble {
   @Equal
   private Long fred;

   @Equal
   private String wilma;
}

would build a new:

   public boolean equals(Object value) {
       Rubble rubbleValue = (Rubble)value;
       return (fred.equals(rubbleValue.fred &&
                      wilma.equals(rubbleValue.wilma));
}

Obviously the example equals method logic isn't complete.  I would
probably use EqualsBuilder or something to make it easier.

TIA

Neil Hart



Back to the top