Package eu.bandm.tools.d2d2.base
Class Options
Generated source for command line processing.
The parallel GUI class is
The normal way of operation is:
As default language the English language has been chosen, because it is lingua franca of computer science.
The parallel GUI class is
OptionsGui
. The normal way of operation is:
- Create a fresh instance by the only constructor
Options()
. - Analyse command line by invoking
Model.parse(String[],MessageReceiver,String)
- Inquire whether a particular
option X has been set on the commandline
by invoking
has_[X]()
. - 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 byget_[X]_[n]()
. - 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
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
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Programmatically generated catalog of translations.static enum
This enum type indicates: Select very different operation modes of this tool.class
One instance realizes one repeated argument group of optionadditionalSources
.class
One instance realizes one repeated argument group of optionpath
.class
One instance realizes one repeated argument group of optionstylesheetParamFiles
.class
One instance realizes one repeated argument group of optionstylesheetParams
.Nested classes/interfaces inherited from class eu.bandm.tools.option.runtime.Model
Model.ExcDuplicate, Model.ExcEndOfRepet, Model.ExcNoData, Model.ExcNoData_allowed, Model.ExcSkipReachesEnd, Model.ExcUnknownOpt, Model.ExcWrongType, Model.Pre20220613, Model.SeemsToWorkForLinuxAndSomeWindowsVersions20220613
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected List<Options.Values_additionalSources>
protected List<Options.Values_path>
protected List<Options.Values_stylesheetParamFiles>
protected List<Options.Values_stylesheetParams>
final Function<Options.Values_path,
String> protected String
protected int
protected int
protected String
protected int
protected Options.modes
protected String
protected String
protected boolean
protected boolean
protected boolean
Fields inherited from class eu.bandm.tools.option.runtime.Model
curArg, curArgGroup, curOption, currentErrorPos, descriptions, dummyRat, GNU_VERSION_OPTION, hasNonMetaOptions, inputlength, inputstring, matcher, messages, msg, nextToken, optionDirector, p_rest, positionalPhase, positionalsExplicit, positionalsFound, protocol, shellAdapter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Callback, overridden by compiled code.Is overridden in the generated code and concatenates the "longest names" of all otions marked as required, but not present in the parsed input.Callback, overridden by compiled code.protected void
The generated code will evaluate all conditions to activate/deactive options in the GUI.Getter method for all repetition groups of optionadditionalSources
.get_additionalSources_0
(int index) Getter method for the only repeated argument of optionadditionalSources
.Getter method for the only argument of optiond2dSource
.int
Getter method for the only argument of optiondebug
.int
Getter method for the only argument of optioninteractive
.Getter method for the only argument of optionkey
.int
Getter method for the only argument of optionlineWidth
.Getter method for the only argument of optionmode
.Getter method for the only argument of optionmodule
.Getter method for the only argument of optionoutputfile
.boolean
Getter method for the only argument of optionpartialdocs
.get_path()
Getter method for all repetition groups of optionpath
.get_path_0
(int index) Getter method for the only repeated argument of optionpath
.boolean
Getter method for the only argument of optionstatic
.Getter method for all repetition groups of optionstylesheetParamFiles
.get_stylesheetParamFiles_0
(int index) Getter method for the only repeated argument of optionstylesheetParamFiles
.Getter method for all repetition groups of optionstylesheetParams
.get_stylesheetParams_0
(int index) Getter method for the 0th in a group of repeated arguments of optionstylesheetParams
.get_stylesheetParams_1
(int index) Getter method for the 1st in a group of repeated arguments of optionstylesheetParams
.boolean
Getter method for the 0th argument of optionversion
.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
has_key()
Deprecated.boolean
Deprecated.boolean
has_mode()
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
has_path()
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.boolean
Deprecated.Overriden by the generated code to make a constructor call of the actual Model (sub-)class.protected int
The generated code will return the number of positional parameters.protected void
parseAbbrev
(String select) Callback, overridden by compiled code, which realizes a switch over all one character option names.protected void
Callback, overridden by compiled code, which realizes a switch over all long option names.protected void
Callback, overridden by compiled code, which calls one after the other the positional parameters.Called to generate a String representation of the model's state.void
usage
(PrintStream pr) Print usage information in the default language.void
usage
(PrintStream pr, String lang) Print usage information in the requested language.void
usage_de()
Print usage information in the language 'de' on System.err.void
usage_de
(PrintStream pr) Print usage information in the language 'de'.void
usage_en()
Print usage information in the language 'en' on System.err.void
usage_en
(PrintStream pr) Print usage information in the language 'en'.Methods inherited from class eu.bandm.tools.option.runtime.Model
ARG_ERROR, ARG_ERROR, canReenterRepetitionGroup, convert_integer_10_or_16, descriptionKeyForCommentField, descriptionKeyForEnum, descriptionKeyForEnum, descriptionKeyForEnumItem, ERROR, ERROR_plus, ERROR_UNKNOWN_ABBREV, ERROR_UNKNOWN_NAME, getInputString, getMissingOptions, getNextToken, getNextToken_required, getParsingProtocol, HINT, input_as_its_own_id, INSITU, parse, parseBool, parseBool_optional, parseBoolTest, parseEnum, parseEnumSet, parseFloat, parseInit, parseInt, parseInt_16or10, parseOneString, parseOneString, parseOneString, parseOneUri, parseRational, parseString, putprot, putprot_option, serialize, serialize, serialize, serialize, serialize, serialize, serialize, serialize, serialize_hex, skipToOption, type_error, TYPE_MISMATCH, TYPE_MISMATCH, usage, usage, WARNING
-
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
-
has_path
protected boolean has_path -
repvalues_path
-
serialize_path
-
has_module
protected boolean has_module -
value_module_0
-
active_module
protected boolean active_module -
has_d2dSource
protected boolean has_d2dSource -
value_d2dSource_0
-
active_d2dSource
protected boolean active_d2dSource -
has_key
protected boolean has_key -
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
-
serialize_additionalSources
-
active_additionalSources
protected boolean active_additionalSources -
has_outputfile
protected boolean has_outputfile -
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
-
serialize_stylesheetParams
-
active_stylesheetParams
protected boolean active_stylesheetParams -
has_stylesheetParamFiles
protected boolean has_stylesheetParamFiles -
repvalues_stylesheetParamFiles
-
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
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 classModel<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 classModel<Options>
-
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 optionversion
.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.- 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
Getter method for the only argument of optionmode
.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.- 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
Getter method for all repetition groups of optionpath
.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
Getter method for the only repeated argument of optionpath
. For details of this option see the methodget_path()
.- Parameters:
index
- the index of the repetition group, zero based.
-
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
Getter method for the only argument of optionmodule
.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.- 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
Getter method for the only argument of optiond2dSource
.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.- 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
Getter method for the only argument of optionkey
.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.- 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 optionstatic
.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.- 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
Getter method for all repetition groups of optionadditionalSources
.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
Getter method for the only repeated argument of optionadditionalSources
. For details of this option see the methodget_additionalSources()
.- Parameters:
index
- the index of the repetition group, zero based.
-
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
Getter method for the only argument of optionoutputfile
.This option indicates: output file.
The format of this option on the command line is--outputfile uri(="")
-
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 optiondebug
.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.- 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 optioninteractive
.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.- 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 optionpartialdocs
.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.- 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
Getter method for all repetition groups of optionstylesheetParams
.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
Getter method for the 0th in a group of repeated arguments of optionstylesheetParams
. For details of this option see the methodget_stylesheetParams()
.- Parameters:
index
- the index of the repetition group, zero based.
-
get_stylesheetParams_1
Getter method for the 1st in a group of repeated arguments of optionstylesheetParams
. For details of this option see the methodget_stylesheetParams()
.- Parameters:
index
- the index of the repetition group, zero based.
-
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
Getter method for all repetition groups of optionstylesheetParamFiles
.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
Getter method for the only repeated argument of optionstylesheetParamFiles
. For details of this option see the methodget_stylesheetParamFiles()
.- Parameters:
index
- the index of the repetition group, zero based.
-
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 optionlineWidth
.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
Description copied from class:Model
Called to generate a String representation of the model's state. Code is overridden by the compiled code. -
usage
Print usage information in the default language. -
usage
Print usage information in the requested language. Falls back to default language, if that language is not supported. -
usage_de
public void usage_de()Print usage information in the language 'de' on System.err. -
usage_de
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
Print usage information in the language 'en'. -
parseAbbrev
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 classModel<Options>
- Parameters:
select
- the one-character option name, as parsed by this code.
-
parseName
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. -
numberOfPositionals
protected int numberOfPositionals()Description copied from class:Model
The generated code will return the number of positional parameters.- Specified by:
numberOfPositionals
in classModel<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 classModel<Options>
-
_finalCheck
protected void _finalCheck()Description copied from class:Model
Callback, overridden by compiled code.- Specified by:
_finalCheck
in classModel<Options>
-
_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 classModel<Options>
-
_getRedundantOptions
Description copied from class:Model
Callback, overridden by compiled code.- Specified by:
_getRedundantOptions
in classModel<Options>
-