• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Configurable Global Variables

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic