Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

Parameters (command line, preferences, user input)

Thread view: 
Kenneth P. Turvey - 25 Feb 2006 08:58 GMT
I'm looking for a general way to handle a fairly large number of
parameters used by a program that I can apply to future work I do.  These
programs are all command line programs and don't have a GUI.

I started implementing this for a project I'm working on and it just
seemed like something that someone else has to have done.  

Ideally, what I would like is something like this:

1) Reads in default parameters from preferences.
2) Overrides these defaults using command line switches (long ones)
3) Prompt the user to input anything that is still required.
4) Writes out any changes the user made to preferences (not including
  command line changes, probably).  The user should be able to disable
  this with a command line switch.

There should be a simple way of handling dependencies e.g. XoverProportion
doesn't matter since Xover wasn't selected so the user isn't prompted for
it.  

Access to parameters should be very fast.  

Is there some open source code out there for this?

Thank you,

- --
Kenneth P. Turvey <kt-usenet@squeakydolphin.com>
Phone : (314) 255-2199

XMPP  IM: kpturvey@jabber.org
Yahoo IM: kpturvey2
AIM   IM: kpturvey3
ICQ   IM: 320005929
Paul Hamaker - 25 Feb 2006 10:10 GMT
You can use the Properties class for this :
http://java.sun.com/docs/books/tutorial/essential/attributes/properties.html
describes exactly what you want.
Using properties on a server from an applet :
http://javalessons.com/cgi-bin/fun/java-tutorials-main.cgi?ses=ao789&sub=adv&code=pro
---------------
Paul Hamaker, SEMM, teaching ICT since 1987
http://javalessons.com


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.