Class Options


public class Options extends Model<Options>
Generated source for command line processing.
(A parallel GUI class has not been generated. 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.

There have been description texts only in one language, namely en.

The usage() method will show this screen:

 ======
 usage:
 ======
 -0 / --destdir        string(="")
 file system mounting point of the generated source tree
 -1 / --pkgname        string(="")
 name of the generated package. Determines the position of generated resources
    relative to destdir
 -2 / --sourcedtd      string(="")
 file position of dtd to compile
 --linewidth      int(=78)
 number of columns for the generated Java source text. This is NOT a strict 
    limit, but a strong orientation.
 --patterns       (bool)?(=true iff present)
 whether "paisley"  pattern access methods shall be generated.
 --noCompress     (bool)?(=true iff present)
 whether the decode/encode methods shall be omitted
 --commonContentClass  (bool)?(=true iff present)
 whether to generate only one common subclass of MixedContent for PCData only 
    elements per model
 -C / --baseClass      string(="eu.bandm.tools.tdom.runtime.TypedElement")
 base class for all generated element classes 
 --generateLists  boolean(=false)
 generate checked list classes for repeated sub-contents, not arrays 
 
 
Created on 2024-11-24_11h57m41
by program bandm/metatools/option/compiler, version 2.1
command line =
java bandm/metatools/option/compiler Options.xml eu.bandm.tools.tdom Options $(HOME)/metatools/src
  • Field Details

    • has_destdir

      protected boolean has_destdir
    • value_destdir_0

      protected String value_destdir_0
    • has_pkgname

      protected boolean has_pkgname
    • value_pkgname_0

      protected String value_pkgname_0
    • has_sourcedtd

      protected boolean has_sourcedtd
    • value_sourcedtd_0

      protected String value_sourcedtd_0
    • has_linewidth

      protected boolean has_linewidth
    • value_linewidth_0

      protected int value_linewidth_0
    • has_patterns

      protected boolean has_patterns
    • value_patterns_0

      protected boolean value_patterns_0
    • has_noCompress

      protected boolean has_noCompress
    • value_noCompress_0

      protected boolean value_noCompress_0
    • has_commonContentClass

      protected boolean has_commonContentClass
    • value_commonContentClass_0

      protected boolean value_commonContentClass_0
    • has_baseClass

      protected boolean has_baseClass
    • value_baseClass_0

      protected String value_baseClass_0
    • has_generateLists

      protected boolean has_generateLists
    • value_generateLists_0

      protected boolean value_generateLists_0
  • 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_destdir

      @Deprecated public boolean has_destdir()
      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_destdir_0().
    • get_destdir_0

      public String get_destdir_0()
      Getter method for the only argument of option destdir.
      This option indicates: file system mounting point of the generated source tree.

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

      @Deprecated public boolean has_pkgname()
      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_pkgname_0().
    • get_pkgname_0

      public String get_pkgname_0()
      Getter method for the only argument of option pkgname.
      This option indicates: name of the generated package. Determines the position of generated resources relative to destdir.

      The format of this option on the command line is
       
         -1 / --pkgname        string(="")
       
    • has_sourcedtd

      @Deprecated public boolean has_sourcedtd()
      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_sourcedtd_0().
    • get_sourcedtd_0

      public String get_sourcedtd_0()
      Getter method for the only argument of option sourcedtd.
      This option indicates: file position of dtd to compile.

      The format of this option on the command line is
       
         -2 / --sourcedtd      string(="")
       
    • 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: number of columns for the generated Java source text. This is NOT a strict limit, but a strong orientation.

      The format of this option on the command line is
       
              --linewidth      int(=78)
       
    • has_patterns

      @Deprecated public boolean has_patterns()
      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_patterns_0().
    • get_patterns_0

      public boolean get_patterns_0()
      Getter method for the only argument of option patterns.
      This option indicates: whether "paisley" pattern access methods shall be generated.

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

      @Deprecated public boolean has_noCompress()
      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_noCompress_0().
    • get_noCompress_0

      public boolean get_noCompress_0()
      Getter method for the 0th argument of option noCompress.
      This option indicates: whether the decode/encode methods shall be omitted.

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

      @Deprecated public boolean has_commonContentClass()
      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_commonContentClass_0().
    • get_commonContentClass_0

      public boolean get_commonContentClass_0()
      Getter method for the 0th argument of option commonContentClass.
      This option indicates: whether to generate only one common subclass of MixedContent for PCData only elements per model.

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

      @Deprecated public boolean has_baseClass()
      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_baseClass_0().
    • get_baseClass_0

      public String get_baseClass_0()
      Getter method for the only argument of option baseClass.
      This option indicates: base class for all generated element classes.

      The format of this option on the command line is
       
         -C / --baseClass      string(="eu.bandm.tools.tdom.runtime.TypedElement")
       
    • has_generateLists

      @Deprecated public boolean has_generateLists()
      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_generateLists_0().
    • get_generateLists_0

      public boolean get_generateLists_0()
      Getter method for the only argument of option generateLists.
      This option indicates: generate checked list classes for repeated sub-contents, not arrays.

      The format of this option on the command line is
       
              --generateLists  boolean(=false)
       
    • 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_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>