actually I am not really an advanced Java programmer, but I think that I do have to solve an advanced Java Problem :).

My current goal is to write a framework that needs to be configured via Annotations. In the last days I read a lot about annotations, how to "parse" them, and so on but still I don't have a clue on how to configure anything with it.

If I need to modify the source (and afaik the annotations are located in the source) , to my way of thinking the configuration via annotations is completely useless or better done in a configuration file. I am quite sure that I miss something essential I only don't know what.

Can please someone help me a bit or give me some hints or maybe even some book/paper/website/... suggestions.

Oh jea I need to do this for university so I can't modify the task.

Thank you a lot in advance.

03-11-2011, 08:08 PM

lovelesh

Hi Pinas,

Just think it to be a task, where in you have to generate an XML file (based on the annotations used in different java classes). this shuldn't be a problem.

Once you are done with generating the xml file, this would be like other frameworks.

Divide your task into smaller chunks, then see how to solve those chunks. As I said creating an xml file, it can be proceeded like:
1. define your own annotations.
2. so whenever your annotation is used, you should generate an xml block corresponding to that particular annotation.
3. add the generated block to application level xml file.
4. then you should have a parser class which parses your generated xml file and does the necessary tasks.