Class Options


public class Options extends Model<Options>
Generated source for command line processing.
The parallel GUI class is OptionsGui.
The normal way of operation is:
  1. Create a fresh instance by the only constructor Options().
  2. Analyse command line by invoking Model.parse(String[],MessageReceiver,String)
  3. Inquire whether a particular option X has been set on the commandline by invoking has_[X]().
  4. The arguments of each option are determined by a sequence of types: first a leading sequence, values for which appear exactly once, followed by a sequence which may be repeated. Both type sequences may be empty.
    Inquire value of the options n-th argument in the fixed, leading argument sequence by get_[X]_[n]().
  5. Inquire value of the options n-th argument in the k-th repetition group by get_[X]_[n](k).

If anything went wrong in parsing, errors have been sent to the MessageReceiver. Then further analysis methods can be applied (Model.getParsingProtocol(), Model.getMissingOptions(), Model.usage(), etc.)
For further details. please see the documentation of the methods inherited from the superclass Model and the option compiler's user documentation.

Here is the source text.

Internationalization

The documentation texts in the option definition file are multi-lingual. There are entries in the languages de and en.
As default language the English language has been chosen, because it is lingua franca of computer science.

The usage() method will show this screen:

 ===================
 command line usage:
 ===================
 -v / --version        (bool)?(=true iff present)
 show application and version information
 -m / --mode           modes(=null)
 for what kind of task this application is called
 -p / --path           ( string 
 )*(="LIB_GP","RES_eu.bandm.tools.doctypes.DocTypes/xhtml")
 where to look for type definition modules
 -0 / --module         string(="")
 Name of the definiton module to process.
 COND=¬modes.text2xml=mode_0
 --d2dSource      uri(="")
 D2d input file to translate to XML.
 COND=modes.text2xml=mode_0
 -k / --key            string(="")
 the target language for which documentation shall be generated; or the pair 
    'module:element' into which xslt code shall be extracted 
 COND=(modes.ddf2doc=mode_0∨modes.ddf2xslt=mode_0∨modes.ddf2dtd=mode_0)
 --static         (bool)?(=true iff present)
 Whether the static = un-instantiated structure of the given source text 
    module shall be documented, not its instantiation.
 COND=(modes.ddf2doc=mode_0∨modes.ddf2format=mode_0∨modes.ddf2tsoap=mode_0)
 --additionalSources  ( uri(="") )*
 additional source files, currently only used for documentation and 
    transformation definitions. 
 COND=(modes.ddf2doc=mode_0∨modes.ddf2xslt=mode_0)
 --outputfile     uri(="")
 output file 
 -d / --debug          int(=1)
 debug level, 0=silent 100=maximal verbose
 --interactive    int(=0)
 which info to print in case of error: (=1) stack situation (=2) generated 
    output so far 
 COND=modes.ddf2xslt=mode_0
 --partialdocs    (bool)?(=true iff present)
 whether partially correct but incomplete documents may be  produced.
 COND=(modes.ddf2xslt=mode_0)
 --stylesheetParams  ( string(="") string(="") )*
 explicit pairs key:value of parameters for an xslt style sheet processing.
 COND=modes.ddf2doc=mode_0
 --stylesheetParamFiles  ( uri(="") )*
 list of files containing parameters for xslt processing.
 COND=modes.ddf2doc=mode_0
 --lineWidth      int(=70)
 Width of a line---for most print out procedures.
 COND=¬(modes.ddf2tsoap=mode_0)
 
 modes:    Select very different operation modes of this tool
 *         text2xml:    Translate one(1) d2d text input files into one(1) 
 standard xml file.
 *          ddf2dtd:    Generate a standard dtd from a d2d module definition.
 *       ddf2format:    Export a pretty-printed source text of the d2d 
 definition module 
 *          ddf2doc:    Generate xhtml documentation for a d2d module (select 
 reader's language.)
 *         ddf2xslt:    Write out the xslt rules (in d2d format) for 
 particular d2d module and target format
 *        ddf2tsoap:    Write down the tsoap serialization of the d2d 
 definition module
 
 
Created on 2024-11-24_12h00m35
by program bandm/metatools/option/compiler, version 2.1
command line =
java bandm/metatools/option/compiler d2dOptions.xml eu.bandm.tools.d2d2.base Options OptionsGui $(HOME)/metatools/src
  • Field Details

    • has_version

      protected boolean has_version
    • value_version_0

      protected boolean value_version_0
    • has_mode

      protected boolean has_mode
    • value_mode_0

      protected Options.modes value_mode_0
    • has_path

      protected boolean has_path
    • repvalues_path

      protected List<Options.Values_path> repvalues_path
    • serialize_path

      public final Function<Options.Values_path,String> serialize_path
    • has_module

      protected boolean has_module
    • value_module_0

      protected String value_module_0
    • active_module

      protected boolean active_module
    • has_d2dSource

      protected boolean has_d2dSource
    • value_d2dSource_0

      protected String value_d2dSource_0
    • active_d2dSource

      protected boolean active_d2dSource
    • has_key

      protected boolean has_key
    • value_key_0

      protected String value_key_0
    • active_key

      protected boolean active_key
    • has_static

      protected boolean has_static
    • value_static_0

      protected boolean value_static_0
    • active_static

      protected boolean active_static
    • has_additionalSources

      protected boolean has_additionalSources
    • repvalues_additionalSources

      protected List<Options.Values_additionalSources> repvalues_additionalSources
    • serialize_additionalSources

      public final Function<Options.Values_additionalSources,String> serialize_additionalSources
    • active_additionalSources

      protected boolean active_additionalSources
    • has_outputfile

      protected boolean has_outputfile
    • value_outputfile_0

      protected String value_outputfile_0
    • has_debug

      protected boolean has_debug
    • value_debug_0

      protected int value_debug_0
    • has_interactive

      protected boolean has_interactive
    • value_interactive_0

      protected int value_interactive_0
    • active_interactive

      protected boolean active_interactive
    • has_partialdocs

      protected boolean has_partialdocs
    • value_partialdocs_0

      protected boolean value_partialdocs_0
    • active_partialdocs

      protected boolean active_partialdocs
    • has_stylesheetParams

      protected boolean has_stylesheetParams
    • repvalues_stylesheetParams

      protected List<Options.Values_stylesheetParams> repvalues_stylesheetParams
    • serialize_stylesheetParams

      public final Function<Options.Values_stylesheetParams,String> serialize_stylesheetParams
    • active_stylesheetParams

      protected boolean active_stylesheetParams
    • has_stylesheetParamFiles

      protected boolean has_stylesheetParamFiles
    • repvalues_stylesheetParamFiles

      protected List<Options.Values_stylesheetParamFiles> repvalues_stylesheetParamFiles
    • serialize_stylesheetParamFiles

      public final Function<Options.Values_stylesheetParamFiles,String> serialize_stylesheetParamFiles
    • active_stylesheetParamFiles

      protected boolean active_stylesheetParamFiles
    • has_lineWidth

      protected boolean has_lineWidth
    • value_lineWidth_0

      protected int value_lineWidth_0
    • active_lineWidth

      protected boolean active_lineWidth
  • Constructor Details

    • Options

      public Options()
  • Method Details

    • makeDefaultInstance

      public Options makeDefaultInstance()
      Description copied from class: Model
      Overriden by the generated code to make a constructor call of the actual Model (sub-)class.
      Specified by:
      makeDefaultInstance in class Model<Options>
    • checkActive

      protected void checkActive()
      Description copied from class: Model
      The generated code will evaluate all conditions to activate/deactive options in the GUI.
      Specified by:
      checkActive in class Model<Options>
    • has_version

      @Deprecated public boolean has_version()
      Deprecated.
      Returns:
      whether the option has been set on the command line. (The result is of no significance when using GUI input, and should neither be used in command line mode.) For details of this option see the method get_version_0().
    • get_version_0

      public boolean get_version_0()
      Getter method for the 0th argument of option version.
      This option indicates: show application and version information.

      The format of this option on the command line is
       
         -v / --version        (bool)?(=true iff present)
       
    • has_mode

      @Deprecated public boolean has_mode()
      Deprecated.
      Returns:
      whether the option has been set on the command line. (The result is of no significance when using GUI input, and should neither be used in command line mode.) For details of this option see the method get_mode_0().
    • get_mode_0

      public Options.modes get_mode_0()
      Getter method for the only argument of option mode.
      This option indicates: for what kind of task this application is called.

      The format of this option on the command line is
       
         -m / --mode           modes(=null)
       
    • has_path

      @Deprecated public boolean has_path()
      Deprecated.
      Returns:
      whether the option has been set on the command line. (The result is of no significance when using GUI input, and should neither be used in command line mode.) For details of this option see the method get_path().
    • get_path

      public List<Options.Values_path> get_path()
      Getter method for all repetition groups of option path.
      This option indicates: where to look for type definition modules.

      The format of this option on the command line is
       
         -p / --path           ( string )*(="LIB_GP","RES_eu.bandm.tools.doctypes.DocTypes/xhtml")
       
    • get_path_0

      public String get_path_0(int index)
      Getter method for the only repeated argument of option path. For details of this option see the method get_path().
      Parameters:
      index - the index of the repetition group, zero based.
    • has_module

      @Deprecated public boolean has_module()
      Deprecated.
      Returns:
      whether the option has been set on the command line. (The result is of no significance when using GUI input, and should neither be used in command line mode.) For details of this option see the method get_module_0().
    • get_module_0

      public String get_module_0()
      Getter method for the only argument of option module.
      This option indicates: Name of the definiton module to process.

      The format of this option on the command line is
       
         -0 / --module         string(="")
       
    • has_d2dSource

      @Deprecated public boolean has_d2dSource()
      Deprecated.
      Returns:
      whether the option has been set on the command line. (The result is of no significance when using GUI input, and should neither be used in command line mode.) For details of this option see the method get_d2dSource_0().
    • get_d2dSource_0

      public String get_d2dSource_0()
      Getter method for the only argument of option d2dSource.
      This option indicates: D2d input file to translate to XML.

      The format of this option on the command line is
       
              --d2dSource      uri(="")
       
    • has_key

      @Deprecated public boolean has_key()
      Deprecated.
      Returns:
      whether the option has been set on the command line. (The result is of no significance when using GUI input, and should neither be used in command line mode.) For details of this option see the method get_key_0().
    • get_key_0

      public String get_key_0()
      Getter method for the only argument of option key.
      This option indicates: the target language for which documentation shall be generated; or the pair 'module:element' into which xslt code shall be extracted.

      The format of this option on the command line is
       
         -k / --key            string(="")
       
    • has_static

      @Deprecated public boolean has_static()
      Deprecated.
      Returns:
      whether the option has been set on the command line. (The result is of no significance when using GUI input, and should neither be used in command line mode.) For details of this option see the method get_static_0().
    • get_static_0

      public boolean get_static_0()
      Getter method for the only argument of option static.
      This option indicates: Whether the static = un-instantiated structure of the given source text module shall be documented, not its instantiation.

      The format of this option on the command line is
       
              --static         (bool)?(=true iff present)
       
    • has_additionalSources

      @Deprecated public boolean has_additionalSources()
      Deprecated.
      Returns:
      whether the option has been set on the command line. (The result is of no significance when using GUI input, and should neither be used in command line mode.) For details of this option see the method get_additionalSources().
    • get_additionalSources

      public List<Options.Values_additionalSources> get_additionalSources()
      Getter method for all repetition groups of option additionalSources.
      This option indicates: additional source files, currently only used for documentation and transformation definitions.

      The format of this option on the command line is
       
              --additionalSources  ( uri(="") )*
       
    • get_additionalSources_0

      public String get_additionalSources_0(int index)
      Getter method for the only repeated argument of option additionalSources. For details of this option see the method get_additionalSources().
      Parameters:
      index - the index of the repetition group, zero based.
    • has_outputfile

      @Deprecated public boolean has_outputfile()
      Deprecated.
      Returns:
      whether the option has been set on the command line. (The result is of no significance when using GUI input, and should neither be used in command line mode.) For details of this option see the method get_outputfile_0().
    • get_outputfile_0

      public String get_outputfile_0()
      Getter method for the only argument of option outputfile.
      This option indicates: output file.

      The format of this option on the command line is
       
              --outputfile     uri(="")
       
    • has_debug

      @Deprecated public boolean has_debug()
      Deprecated.
      Returns:
      whether the option has been set on the command line. (The result is of no significance when using GUI input, and should neither be used in command line mode.) For details of this option see the method get_debug_0().
    • get_debug_0

      public int get_debug_0()
      Getter method for the only argument of option debug.
      This option indicates: debug level, 0=silent 100=maximal verbose.

      The format of this option on the command line is
       
         -d / --debug          int(=1)
       
    • has_interactive

      @Deprecated public boolean has_interactive()
      Deprecated.
      Returns:
      whether the option has been set on the command line. (The result is of no significance when using GUI input, and should neither be used in command line mode.) For details of this option see the method get_interactive_0().
    • get_interactive_0

      public int get_interactive_0()
      Getter method for the only argument of option interactive.
      This option indicates: which info to print in case of error: (=1) stack situation (=2) generated output so far.

      The format of this option on the command line is
       
              --interactive    int(=0)
       
    • has_partialdocs

      @Deprecated public boolean has_partialdocs()
      Deprecated.
      Returns:
      whether the option has been set on the command line. (The result is of no significance when using GUI input, and should neither be used in command line mode.) For details of this option see the method get_partialdocs_0().
    • get_partialdocs_0

      public boolean get_partialdocs_0()
      Getter method for the only argument of option partialdocs.
      This option indicates: whether partially correct but incomplete documents may be produced.

      The format of this option on the command line is
       
              --partialdocs    (bool)?(=true iff present)
       
    • has_stylesheetParams

      @Deprecated public boolean has_stylesheetParams()
      Deprecated.
      Returns:
      whether the option has been set on the command line. (The result is of no significance when using GUI input, and should neither be used in command line mode.) For details of this option see the method get_stylesheetParams().
    • get_stylesheetParams

      public List<Options.Values_stylesheetParams> get_stylesheetParams()
      Getter method for all repetition groups of option stylesheetParams.
      This option indicates: explicit pairs key:value of parameters for an xslt style sheet processing.

      The format of this option on the command line is
       
              --stylesheetParams  ( string(="") string(="") )*
       
    • get_stylesheetParams_0

      public String get_stylesheetParams_0(int index)
      Getter method for the 0th in a group of repeated arguments of option stylesheetParams. For details of this option see the method get_stylesheetParams().
      Parameters:
      index - the index of the repetition group, zero based.
    • get_stylesheetParams_1

      public String get_stylesheetParams_1(int index)
      Getter method for the 1st in a group of repeated arguments of option stylesheetParams. For details of this option see the method get_stylesheetParams().
      Parameters:
      index - the index of the repetition group, zero based.
    • has_stylesheetParamFiles

      @Deprecated public boolean has_stylesheetParamFiles()
      Deprecated.
      Returns:
      whether the option has been set on the command line. (The result is of no significance when using GUI input, and should neither be used in command line mode.) For details of this option see the method get_stylesheetParamFiles().
    • get_stylesheetParamFiles

      public List<Options.Values_stylesheetParamFiles> get_stylesheetParamFiles()
      Getter method for all repetition groups of option stylesheetParamFiles.
      This option indicates: list of files containing parameters for xslt processing.

      The format of this option on the command line is
       
              --stylesheetParamFiles  ( uri(="") )*
       
    • get_stylesheetParamFiles_0

      public String get_stylesheetParamFiles_0(int index)
      Getter method for the only repeated argument of option stylesheetParamFiles. For details of this option see the method get_stylesheetParamFiles().
      Parameters:
      index - the index of the repetition group, zero based.
    • has_lineWidth

      @Deprecated public boolean has_lineWidth()
      Deprecated.
      Returns:
      whether the option has been set on the command line. (The result is of no significance when using GUI input, and should neither be used in command line mode.) For details of this option see the method get_lineWidth_0().
    • get_lineWidth_0

      public int get_lineWidth_0()
      Getter method for the only argument of option lineWidth.
      This option indicates: Width of a line---for most print out procedures.

      The format of this option on the command line is
       
              --lineWidth      int(=70)
       
    • serialize

      public String serialize()
      Description copied from class: Model
      Called to generate a String representation of the model's state. Code is overridden by the compiled code.
      Specified by:
      serialize in class Model<Options>
    • usage

      public void usage(PrintStream pr)
      Print usage information in the default language.
      Specified by:
      usage in class Model<Options>
    • usage

      public void usage(PrintStream pr, String lang)
      Print usage information in the requested language. Falls back to default language, if that language is not supported.
      Specified by:
      usage in class Model<Options>
    • usage_de

      public void usage_de()
      Print usage information in the language 'de' on System.err.
    • usage_de

      public void usage_de(PrintStream pr)
      Print usage information in the language 'de'.
    • usage_en

      public void usage_en()
      Print usage information in the language 'en' on System.err.
    • usage_en

      public void usage_en(PrintStream pr)
      Print usage information in the language 'en'.
    • parseAbbrev

      protected void parseAbbrev(String select)
      Description copied from class: Model
      Callback, overridden by compiled code, which realizes a switch over all one character option names. The generated code calls the argument parsers and stores the resulting values to the model's fields.
      Specified by:
      parseAbbrev in class Model<Options>
      Parameters:
      select - the one-character option name, as parsed by this code.
    • parseName

      protected void parseName(String select)
      Description copied from class: Model
      Callback, overridden by compiled code, which realizes a switch over all long option names. The generated code calls the argument parsers and stores the resulting values to the model's fields.
      Specified by:
      parseName in class Model<Options>
      Parameters:
      select - the multi-character option name, as parsed by this code.
    • numberOfPositionals

      protected int numberOfPositionals()
      Description copied from class: Model
      The generated code will return the number of positional parameters.
      Specified by:
      numberOfPositionals in class Model<Options>
    • parsePositionals

      protected void parsePositionals()
      Description copied from class: Model
      Callback, overridden by compiled code, which calls one after the other the positional parameters. Each of them corresponds to an implicit option (with short names "-0", "-1", "-2", ...). These can also be defined explicitly, e.g. be given a long name, etc. Anyhow, they can be set explicitly by their short name. If one single positional option is given explicitly, the implicit parsing of the others is suppressed and this code will not be called.
      Specified by:
      parsePositionals in class Model<Options>
    • _finalCheck

      protected void _finalCheck()
      Description copied from class: Model
      Callback, overridden by compiled code.
      Specified by:
      _finalCheck in class Model<Options>
    • _getMissingOptions

      public String _getMissingOptions()
      Description copied from class: Model
      Is overridden in the generated code and concatenates the "longest names" of all otions marked as required, but not present in the parsed input. Length==0 iff none is missing. Cf "sourcedtd required='yes'" in tools/tdom_withOptions/Options.xml
      Specified by:
      _getMissingOptions in class Model<Options>
    • _getRedundantOptions

      public String _getRedundantOptions()
      Description copied from class: Model
      Callback, overridden by compiled code.
      Specified by:
      _getRedundantOptions in class Model<Options>