I have the following class
public class Person {
...
}
I would like to create another class that would look like this.
@Some
You can use javassist project for that.
With javassist it will be look something like that:
ClassFile cf = ... ;
ConstPool cp = cf.getConstPool();
AnnotationsAttribute attr = new AnnotationsAttribute(cp, AnnotationsAttribute.visibleTag);
Annotation a = new Annotation("Author", cp);
a.addMemberValue("name", new StringMemberValue("Chiba", cp));
attr.setAnnotation(a);
cf.addAttribute(attr);
cf.setVersionToJava5();
Hope it helps. Alexey