gov.llnl.babel
Class UserOptions

java.lang.Object
  extended by gov.llnl.babel.UserOptions
All Implemented Interfaces:
CommandLineExtension

public class UserOptions
extends java.lang.Object
implements CommandLineExtension

Manages the wide variety of settings available to a user. The configuration options are read in through an array of strings (args). Newly specified arguments always replace the values of the previously specified ones with the exception of the repository path where new arguments are appended to the existing list. For developers, to add a new internal Babel option. Create an inner subclass in UserOptions with a name ending in Switch. This class uses reflection to automatically add all inner classes as command line switches.


Nested Class Summary
 class UserOptions.AssertionLevelSwitch
           
 class UserOptions.CCAModeSwitch
           
 class UserOptions.ClientSwitch
           
 class UserOptions.CommentLocalOnlySwitch
           
 class UserOptions.CxxIORExceptionSwitch
           
 class UserOptions.DefaultRepositoryPathSwitch
           
 class UserOptions.ExcludeExternalSwitch
           
 class UserOptions.ExcludeSwitch
           
 class UserOptions.GenerateHooksSwitch
           
 class UserOptions.GenerateSidlStdlibSwitch
           
 class UserOptions.GenerateSubdirOffSwitch
           
 class UserOptions.GenerateSubdirSwitch
           
 class UserOptions.HideGlueOffSwitch
           
 class UserOptions.HideGlueSwitch
           
 class UserOptions.IncludeReferencedSwitch
           
 class UserOptions.LanguageSubdirOffSwitch
           
 class UserOptions.LanguageSubdirSwitch
           
 class UserOptions.MakePrefixSwitch
           
 class UserOptions.MultiResetOption
           
 class UserOptions.MultiSwitch
           
 class UserOptions.NoDefaultRepositorySwitch
           
 class UserOptions.OutputDirectorySwitch
           
 class UserOptions.ParseCheckSwitch
           
 class UserOptions.ParseResolveOption
           
 class UserOptions.RenameSplicerSwitch
           
 class UserOptions.RepositoryPathSwitch
           
static class UserOptions.RequiredArgSwitch
           
 class UserOptions.ServerSwitch
           
 class UserOptions.ShortFileNamesSwitch
           
 class UserOptions.SuppressIORSwitch
           
 class UserOptions.SuppressStubSwitch
           
 class UserOptions.SuppressTimestampSwitch
           
 class UserOptions.TextSwitch
           
 class UserOptions.TimestampSwitch
           
 class UserOptions.TouchOption
           
 class UserOptions.VerboseSwitch
           
 class UserOptions.VersionSwitch
           
 class UserOptions.VpathSwitch
           
 
Constructor Summary
UserOptions(Context context)
          Since this is a singleton class, the constructor is protected.
UserOptions(Context context, Generator gen)
           
 
Method Summary
 int getNumRequired()
          Return the number of required elements on the command line.
 boolean getVersionPrinted()
          Return true iff the version option appeared and it was printed.
 void registerCommandLineSwitches(CommandLineDictionary dict)
          This method should register all command line switches in the dictionary.
 void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserOptions

public UserOptions(Context context)
Since this is a singleton class, the constructor is protected.


UserOptions

public UserOptions(Context context,
                   Generator gen)
Method Detail

registerCommandLineSwitches

public void registerCommandLineSwitches(CommandLineDictionary dict)
                                 throws NameCollisionException
Description copied from interface: CommandLineExtension
This method should register all command line switches in the dictionary. Babel will call this method exactly once on all extensions it loads.

Specified by:
registerCommandLineSwitches in interface CommandLineExtension
Parameters:
dict - the command line switch dictionary in which you register your command line extensions.
Throws:
NameCollisionException - If your extension doesn't know what to do with the exception thrown by calls to CommandLineDictionary.addCommandLineSwitch(gov.llnl.babel.cli.CommandLineSwitch), you can let Babel handle it.

reset

public void reset()

getNumRequired

public int getNumRequired()
Return the number of required elements on the command line.


getVersionPrinted

public boolean getVersionPrinted()
Return true iff the version option appeared and it was printed.