gov.llnl.babel

Class UserOptions

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()

Constructor Details

UserOptions

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

UserOptions

public UserOptions(Context context,
                   Generator gen)

Method Details

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.

registerCommandLineSwitches

public void registerCommandLineSwitches(CommandLineDictionary dict)
            throws NameCollisionException
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(CommandLineSwitch), you can let Babel handle it.

reset

public void reset()