Java GetOpt Generator

Java GetOpt Generator is a software that generates a command-line argument parser from an XML file.
Download

Java GetOpt Generator Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • David Farrell
  • Publisher web site:
  • http://trac.inamik.com/trac/jgetopt_gen

Java GetOpt Generator Tags


Java GetOpt Generator Description

Java GetOpt Generator is a software that generates a command-line argument parser from an XML file. Java GetOpt Generator is a software that generates a command-line argument parser from an XML file.Both a 'parser' and 'config' class are generated, which allows your program to either be launched from the command-line or programmatically configured and executed from another Java application.GetOpt Generator is Self-Hosting meaning it uses itself to generate its command-line parser.ConfigurationYou can look at GetOpt.xml, the XML used by GetOpt to generate its own command-line parser, for an example of what the XML configuration file should look like.Basically each option gets:nameLong name of the option. Separate logical words with "_" (i.e. long_opt)shortShort (1 char) alias for the optiontypeOne of:· boolean· integer· string· input-file (verifies that file exists)· input-dir (verifies that dir exists)· output-file (treated as string for now)· output-dir (treated as string for now)Running GetOptCalling GetOpt with --help generates the following outputoptions for GetOpt : ( --xmlFile | -x ) xml_file ( --javaDir | -j ) java_dir ( --exeClass | -e ) exe_class ( --mainClass | -m ) main_class ( --configClass | -c ) config_classNOTE: Options in brackets '[]' are optional. All camel-case long opts can be represented using lowercase, as well as with '-' or '_' seperating the camel-cased words (i.e. --longOpt | --longopt | --long_opt | --long-opt)xml_fileThe XML file containing the configurationmain_classThe fully qualified name (package+class) of the generated class that will parse the command line (i.e. contains the main() method).config_classThe fully qualified name (package_class) of the generated class that will store the config information.java_dirThe base output directory (i.e. your src directory). The generated files will be stored in /java/dir/package/path/ClassName.javaexe_classThe Java class that the generated command-line parser should call after parsing the command line.The exe class is expected to contain a constructor that accepts a config_class instance.The exe class is expected to contain an execute() method, which will be called by the command-line parser.It is the responsibility of the exe class to validate the parsed config, but the config_class is generated with a validate() function which does the heavy lifting.


Java GetOpt Generator Related Software