file io - Program/Script for automatically annotating Java classes -
file io - Program/Script for automatically annotating Java classes -
i have on one thousand pojos, properties of which, need annotate per custom xml parsing annotations library made. since number of pojos large, , jaxb annotated, need automation of 2 3 tasks :
removal of "all" existing annotations re-annotating pojos 1the rules simple (1) - delete line starts "@"
(2) complex , want start detecting "public class xyz" in java class, , annotating @beanname(beanname="xyz")
after this, action item (3), need observe datatype of variable in pojo, annotate :
@classmember(datatype = datatype.integer, membername = "tripid") public int tripid; @classmember(datatype = datatype.complex, membername = "stop") public stop stop; i think sed script may help too, prefer java, "guess" , may need utilize reflection next steps.
thanks !
edit : understand above cases simple , can achieved using regex tools - need script/program this. if community can help me code "simple" cases this, can extend complex scenarios - "cannot" done (without lot of manual intervention) regex tools built ides.
edit 2 : have added point (3) create problem "real"
intellij's structural search , replace able help. if open write programs seek eclipse ast modification. has sample code start with.
java file-io automation annotations sed
Comments
Post a Comment