Results 1 to 2 of 2
  1. #1
    Pinas is offline Member
    Join Date
    Mar 2011
    Posts
    1
    Rep Power
    0

    Default Configuration via Annotations

    Hi all,

    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.

  2. #2
    lovelesh is offline Senior Member
    Join Date
    Nov 2010
    Location
    Delhi
    Posts
    135
    Blog Entries
    1
    Rep Power
    0

    Post

    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.

    Hope that gives you some idea :-)

Similar Threads

  1. Annotations
    By yogesh_SC in forum Advanced Java
    Replies: 1
    Last Post: 04-02-2009, 10:33 PM
  2. Annotations
    By javarishi in forum Advanced Java
    Replies: 1
    Last Post: 05-02-2008, 11:51 AM
  3. @ annotations
    By mew in forum New To Java
    Replies: 1
    Last Post: 12-12-2007, 12:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •