I\'m a little new to the Java 5 annotations and I\'m curious if either of these are possible:
This annotation would generate a simple getter and setter for you.
It's possible, just not where you're declaring them.
Check out http://code.google.com/p/javadude/wiki/Annotations.
I have a class annotated like
package sample;
import com.javadude.annotation.Bean;
import com.javadude.annotation.Property;
import com.javadude.annotation.PropertyKind;
@Bean(properties={
@Property(name="name"),
@Property(name="phone", bound=true),
@Property(name="friend", type=Person.class, kind=PropertyKind.LIST)
})
public class Person extends PersonGen {}
And it generates the PersonGen class for you, containing getters/setters, etc
The processor also does quite a bit more. Note that I'm working on a new version of it that has a little API breakage from the current version