de.esprit.appsuite.launch

## Class ApplicationCommandLineParser

- java.lang.Object
- - de.esprit.common.clp.CommandLineParser
  - - de.esprit.appsuite.launch.ApplicationCommandLineParser

- Direct Known Subclasses:
    AppStarterCLP, ClientCommandLineParser, DatabaseCommandLineParser, ServerCommandLineParser

      public class ApplicationCommandLineParser
      extends CommandLineParser

  This is the standard command line parser for applications. It adds the standard option -application. All values parsed from the command line are provided within the `ApplicationConfig` object returned by `getConfig()`.
  Author:
    Rainer Buesch

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected de.esprit.appsuite.launch.ApplicationCommandLineParser.MyOptionApplicationName` | `optApplicationName`

    - ### Fields inherited from class de.esprit.common.clp.CommandLineParser

      `espritVersion, optDebug, optDemo, optHelp, optLocale, optLogDir, optLogToFile, optNoConsole, optTest, optVerbose, optVersion`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ApplicationCommandLineParser(java.lang.Class<?> mainClass, java.lang.String... args)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected <F extends ApplicationConfig> F` | `createConfig()` May be overridden to return a specific `ApplicationConfig` derivation which contains all data extracted from the command line.
    `java.lang.String` | `getApplicationName()`
    `<F extends ApplicationConfig> F` | `getConfig()` Parses the command line and returns the `ApplicationConfig` object as created by `createConfig()`.
    `boolean` | `isPrintVersionOnly()`
    `void` | `setDefaultApplicationName(java.lang.String applicationName)`

    - ### Methods inherited from class de.esprit.common.clp.CommandLineParser

      `addOption, addOption, addSoftwareVersion, checkDependencies, createHelpText, createHelpText, createOptionList, createSyntaxLine, ensureParsed, fetchDefinedOptionFor, findDefinedOptionFor, getArgument, getArgumentCount, getArguments, getCustomVersion, getEspritVersion, getLogDir, getMainClass, getSoftwareVersions, getStartLogLevel, handleParsingError, hasArguments, isDebug, isDemoMode, isExitAfterParsing, isLogToFile, isNoConsoleLog, isParsed, isTestMode, isVerbose, parse, removeOption, removeOption`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### optApplicationName

          protected final de.esprit.appsuite.launch.ApplicationCommandLineParser.MyOptionApplicationName optApplicationName

  - ### Constructor Detail

    - #### ApplicationCommandLineParser

          public ApplicationCommandLineParser(java.lang.Class<?> mainClass,
                                      java.lang.String... args)

  - ### Method Detail

    - #### setDefaultApplicationName

          public final void setDefaultApplicationName(java.lang.String applicationName)

    - #### getConfig

          public final <F extends ApplicationConfig> F getConfig()
                                                      throws java.lang.Exception

      Parses the command line and returns the `ApplicationConfig` object as created by `createConfig()`. If parsing fails the application exits and prints the command line help message.
      Throws:
        `java.lang.Exception`

    - #### createConfig

          protected <F extends ApplicationConfig> F createConfig()
                                                      throws java.lang.Exception

      May be overridden to return a specific `ApplicationConfig` derivation which contains all data extracted from the command line.
      Throws:
        `java.lang.Exception`

    - #### getApplicationName

          public java.lang.String getApplicationName()

    - #### isPrintVersionOnly

          public boolean isPrintVersionOnly()

Copyright © 2014 EsprIT-Systems. All Rights Reserved.