• Post Reply Bookmark Topic Watch Topic
  • New Topic

Configurable Global Variables  RSS feed

 
Kian Peng Yong
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear sir/madam,

I am wondering whether it is possible in JAVA programming world ..... I am trying to make global variables configurable from a configuration file. I know I have the option to upload all my variables into a Hastable and always refer to this Hastable for a value. However, I will loose the friendly feature in my java IDE to find the variable list as I write my codes ..... so I am wondering .....

If I have several classes with the same class name (GlobalVariable.java) but under different package and storing variables. For example:


test.utility.file - GlobalVariables.java
test.utility.database - GlobalVariables.java
:
:
test.product.device - GlobalVariables.java



Is there a way to iterate through these GlobalVariables classes and extract into a single Hastable (assuming all variables in these GlobalVariables has a unique name with the Package full path attached in front of the variable name)?

[1] To obtain the list of Package in a project
[2] To obtain all the GlobalVariables classes from [1]
[3] To obtain the list of variables in all the GlobalVariables classes in [2]
[4] Then .... extract these variables [3] and place them into a hashtable

Thank you very much and hope to hear from you soon.

Best regards,
Yong

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!