Class Options


public class Options extends Model<Options>
Generated source for command line processing.
The parallel GUI class is GuiOptions.
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:

 ======
 usage:
 ======
 --sourceDtd      uri(="")
 file position of the dtd source text of the transformations's source format; 
    used for tpath type check only.
 --sourceRoots    ( string(="") )+
 namespace names of possible toplevel source elements, in  '{...}...' pseudo 
    format; used for tpath type check only.
 --tpathFunctions  string(="")
 name of an accessible subclass of 
    eu.bandm.tools.tpath.runtime.FunctionLibrary, defining tpath functions. 
    Defaults to tpath+xslt pre-defined functions.
 --pedantic       boolean(=true)
 whether to follow specification even when it appears hardly sensible 
 --strictCheck    boolean(=true)
 whether to type check unreachable code
 --totalizedTranslation  (bool)?(=true iff present)
 whether to always create a result document, even with errors
 --transformations  string(="") ( string(="") string(="") string(="") )+
 all transformations: input file name pattern, followed by a sequence of (a) 
    an xslt source file  (b) a tdom package name (or '#text') and (c) an 
    output file pattern. 
 --inputFiles     ( uri(="") )+
 file position of the xml sources to transform
 --filesRoot      uri(="")
 common root for input and output file positions, is prepended to each input 
    file before pattern matching application.
 --stylesheetParams  ( string(="") string(="") )*
 parameters parsed to the xslt code and declared there on top-level
 --stylesheetParamsFile  ( string(="") string(="") )*
 one file containing parameters parsed to the xslt code and declared there on 
 top-level
 --linewidth      int(=78)
 number of columns for the generated xml output
 --traceflags     traceflag*(=EnumSet.of( traceflag.silent, 
 traceflag.extendedInfo))
 Sequence of flags, activates the different debug tracing outputs separately.
 --diagnoseSources  ( string(="") int(=0) int(=0) )+
 a sequence of location filters to restrict logging messages to certain areas 
  in the source files.
 --diagnoseObjects  ( string(="") )+
 a sequence of object names to restrict logging messages to certain causing 
  objects in the source files. Given as a mere string, or with an opening 
  brace "{" as a NamespaceName.
 --reportFiles    ( string(="") )+
 a sequence of file names where to write diagnosis information from the 
  analyses of the xslt sources, in their sequential order in --transformations
 
 traceflag:    Switch on/off different trace outputs individually.
 *           silent:    Suppress all log messages, even warnings. Print only 
 errors.
 *     justWarnings:    Suppress all log messages. Print errors and warnings. 
 (Overrides "silent")
 *     extendedInfo:    Print additional information with most messages.
 *       showSource:    Display source text as soon as parsed, and as 
 additional information.
 *     templateDirs:    Dump the template directories as soon they are filled.
 *     globalValues:    Trace calculation of all global values (top-level 
 parameters and variables).
 *   resourceFinding:    Trace the resolution of URLs/URIs/file names and the 
 access to resource objects.
 *   templateResolution:    Trace finding of templates. Includes xsl:for-each 
 application.
 *     templateCall:    Trace parameter set up and code executon start for 
 template calls and applies.
 *        tpathEval:    Trace evaluation of all tpath expressions.
 *       tpathTypes:    Print the results of type checking tpath expressions.
 *   tpathFunctions:    Trace calls, parameters, and results of functions 
 called from tpath expressions.
 *    varAssignment:    Trace assignments to variables.
 *    testDecisions:    Trace the deciding expressions in xsl:if and 
 xsl:choose expressions.
 *   exceptionStackTraces:    Print the java stack trace in case of 
 exceptions.
 *   elementReducing:    Trace the reduce step of a collected result element, 
 ie. the call of the tdom semi-parser.
 *     verbatimText:    Dumps all verbatim inserted XML fragments.
 
 
Created on 2024-09-15_20h24m36
by program bandm/metatools/option/compiler, version 2.1
command line =
java bandm/metatools/option/compiler Options.xml eu.bandm.tools.xslt.base Options GuiOptions $(HOME)/metatools/src
  • Field Details

  • 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_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 the dtd source text of the transformations's source format; used for tpath type check only.

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

      @Deprecated public boolean has_sourceRoots()
      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_sourceRoots().
    • get_sourceRoots

      public List<Options.Values_sourceRoots> get_sourceRoots()
      Getter method for all repetition groups of option sourceRoots.
      This option indicates: namespace names of possible toplevel source elements, in '{...}...' pseudo format; used for tpath type check only.

      The format of this option on the command line is
       
              --sourceRoots    ( string(="") )+
       
    • get_sourceRoots_0

      public String get_sourceRoots_0(int index)
      Getter method for the only repeated argument of option sourceRoots. For details of this option see the method get_sourceRoots().
      Parameters:
      index - the index of the repetition group, zero based.
    • has_tpathFunctions

      @Deprecated public boolean has_tpathFunctions()
      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_tpathFunctions_0().
    • get_tpathFunctions_0

      public String get_tpathFunctions_0()
      Getter method for the only argument of option tpathFunctions.
      This option indicates: name of an accessible subclass of eu.bandm.tools.tpath.runtime.FunctionLibrary, defining tpath functions. Defaults to tpath+xslt pre-defined functions.

      The format of this option on the command line is
       
              --tpathFunctions  string(="")
       
    • has_pedantic

      @Deprecated public boolean has_pedantic()
      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_pedantic_0().
    • get_pedantic_0

      public boolean get_pedantic_0()
      Getter method for the only argument of option pedantic.
      This option indicates: whether to follow specification even when it appears hardly sensible.

      The format of this option on the command line is
       
              --pedantic       boolean(=true)
       
    • has_strictCheck

      @Deprecated public boolean has_strictCheck()
      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_strictCheck_0().
    • get_strictCheck_0

      public boolean get_strictCheck_0()
      Getter method for the only argument of option strictCheck.
      This option indicates: whether to type check unreachable code.

      The format of this option on the command line is
       
              --strictCheck    boolean(=true)
       
    • has_totalizedTranslation

      @Deprecated public boolean has_totalizedTranslation()
      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_totalizedTranslation_0().
    • get_totalizedTranslation_0

      public boolean get_totalizedTranslation_0()
      Getter method for the only argument of option totalizedTranslation.
      This option indicates: whether to always create a result document, even with errors.

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

      @Deprecated public boolean has_transformations()
      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_transformations_0().
    • get_transformations_0

      public String get_transformations_0()
      Getter method for the only argument of option transformations.
      This option indicates: all transformations: input file name pattern, followed by a sequence of (a) an xslt source file (b) a tdom package name (or '#text') and (c) an output file pattern.

      The format of this option on the command line is
       
              --transformations  string(="") ( string(="") string(="") string(="") )+
       
      The other arguments of this option are accessed by the method(s) starting with get_transformations...
    • get_transformations

      public List<Options.Values_transformations> get_transformations()
      Getter method for all repetition groups of option transformations. For details of this option see the method get_transformations_0().
    • get_transformations_0

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

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

      public String get_transformations_2(int index)
      Getter method for the 2nd in a group of repeated arguments of option transformations. For details of this option see the method get_transformations_0().
      Parameters:
      index - the index of the repetition group, zero based.
    • has_inputFiles

      @Deprecated public boolean has_inputFiles()
      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_inputFiles().
    • get_inputFiles

      public List<Options.Values_inputFiles> get_inputFiles()
      Getter method for all repetition groups of option inputFiles.
      This option indicates: file position of the xml sources to transform.

      The format of this option on the command line is
       
              --inputFiles     ( uri(="") )+
       
    • get_inputFiles_0

      public String get_inputFiles_0(int index)
      Getter method for the only repeated argument of option inputFiles. For details of this option see the method get_inputFiles().
      Parameters:
      index - the index of the repetition group, zero based.
    • has_filesRoot

      @Deprecated public boolean has_filesRoot()
      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_filesRoot_0().
    • get_filesRoot_0

      public String get_filesRoot_0()
      Getter method for the only argument of option filesRoot.
      This option indicates: common root for input and output file positions, is prepended to each input file before pattern matching application.

      The format of this option on the command line is
       
              --filesRoot      uri(="")
       
    • 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: parameters parsed to the xslt code and declared there on top-level.

      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_stylesheetParamsFile

      @Deprecated public boolean has_stylesheetParamsFile()
      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_stylesheetParamsFile().
    • get_stylesheetParamsFile

      public List<Options.Values_stylesheetParamsFile> get_stylesheetParamsFile()
      Getter method for all repetition groups of option stylesheetParamsFile.
      This option indicates: one file containing parameters parsed to the xslt code and declared there on top-level.

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

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

      public String get_stylesheetParamsFile_1(int index)
      Getter method for the 1st in a group of repeated arguments of option stylesheetParamsFile. For details of this option see the method get_stylesheetParamsFile().
      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: number of columns for the generated xml output.

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

      @Deprecated public boolean has_traceflags()
      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_traceflags_0().
    • get_traceflags_0

      public EnumSet<Options.traceflag> get_traceflags_0()
      Getter method for the only argument of option traceflags.
      This option indicates: Sequence of flags, activates the different debug tracing outputs separately.

      The format of this option on the command line is
       
              --traceflags     traceflag*(=EnumSet.of( traceflag.silent, traceflag.extendedInfo))
       
    • has_diagnoseSources

      @Deprecated public boolean has_diagnoseSources()
      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_diagnoseSources().
    • get_diagnoseSources

      public List<Options.Values_diagnoseSources> get_diagnoseSources()
      Getter method for all repetition groups of option diagnoseSources.
      This option indicates: a sequence of location filters to restrict logging messages to certain areas in the source files.

      The format of this option on the command line is
       
              --diagnoseSources  ( string(="") int(=0) int(=0) )+
       
    • get_diagnoseSources_0

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

      public int get_diagnoseSources_1(int index)
      Getter method for the 1st in a group of repeated arguments of option diagnoseSources. For details of this option see the method get_diagnoseSources().
      Parameters:
      index - the index of the repetition group, zero based.
    • get_diagnoseSources_2

      public int get_diagnoseSources_2(int index)
      Getter method for the 2nd in a group of repeated arguments of option diagnoseSources. For details of this option see the method get_diagnoseSources().
      Parameters:
      index - the index of the repetition group, zero based.
    • has_diagnoseObjects

      @Deprecated public boolean has_diagnoseObjects()
      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_diagnoseObjects().
    • get_diagnoseObjects

      public List<Options.Values_diagnoseObjects> get_diagnoseObjects()
      Getter method for all repetition groups of option diagnoseObjects.
      This option indicates: a sequence of object names to restrict logging messages to certain causing objects in the source files. Given as a mere string, or with an opening brace "{" as a NamespaceName.

      The format of this option on the command line is
       
              --diagnoseObjects  ( string(="") )+
       
    • get_diagnoseObjects_0

      public String get_diagnoseObjects_0(int index)
      Getter method for the only repeated argument of option diagnoseObjects. For details of this option see the method get_diagnoseObjects().
      Parameters:
      index - the index of the repetition group, zero based.
    • has_reportFiles

      @Deprecated public boolean has_reportFiles()
      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_reportFiles().
    • get_reportFiles

      public List<Options.Values_reportFiles> get_reportFiles()
      Getter method for all repetition groups of option reportFiles.
      This option indicates: a sequence of file names where to write diagnosis information from the analyses of the xslt sources, in their sequential order in --transformations.

      The format of this option on the command line is
       
              --reportFiles    ( string(="") )+
       
    • get_reportFiles_0

      public String get_reportFiles_0(int index)
      Getter method for the only repeated argument of option reportFiles. For details of this option see the method get_reportFiles().
      Parameters:
      index - the index of the repetition group, zero based.
    • 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>