Package eu.bandm.tools.option
Class Compiler.Phase_usage
java.lang.Object
eu.bandm.tools.tdom.runtime.BaseVisitor
eu.bandm.tools.option.absy.Visitor
eu.bandm.tools.option.Compiler.Phase
eu.bandm.tools.option.Compiler.Phase_usage
- All Implemented Interfaces:
PCDataVisitor
- Direct Known Subclasses:
Compiler.Phase_usage_enumerations
,Compiler.Phase_usage_options
- Enclosing class:
- Compiler
Common superclass for
Compiler.Phase_usage_enumerations
and
Compiler.Phase_usage_options
.-
Field Summary
Modifier and TypeFieldDescription(package private) Element_text
The text which matches best the user language or (as fall back) the default language or (as fall-back) any language.(package private) final String
Input parameter: The preferred fall-back language.(package private) final @Opt GeneratedMethod
Input parameter: the usage() method under construction.(package private) boolean
Whether the user language has been hit = no fall back was necessaty.(package private) String
(package private) final String
Input parameter: The (human) user language for which the usage methodgm
is under construction.Fields inherited from class eu.bandm.tools.option.Compiler.Phase
abbrev, currentOptionElement, name, option_qualifier
Fields inherited from class eu.bandm.tools.tdom.runtime.BaseVisitor
validating
-
Constructor Summary
ConstructorDescriptionPhase_usage
(GeneratedMethod gm, String usage_lang, String defaultLanguage) Compile the printing of a found text object to the growing method. -
Method Summary
Modifier and TypeMethodDescription(package private) void
Add the text to the method under construction as a Java statement.protected void
starts a new search for a best test.void
visit
(Element_desc el) Descend and analyse all containedElement_text
.void
visit
(Element_text el) Finds the best fitting explanation translation.Methods inherited from class eu.bandm.tools.option.Compiler.Phase
bothtags, bothtags_formatted, ERROR, longestname, longesttag, shortestname, shortesttag, visit, WARNING, WARNING
Methods inherited from class eu.bandm.tools.option.absy.Visitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
Methods inherited from class eu.bandm.tools.tdom.runtime.BaseVisitor
visit
-
Field Details
-
besttext
Element_text besttextThe text which matches best the user language or (as fall back) the default language or (as fall-back) any language. -
textfound
String textfound -
langhit
boolean langhitWhether the user language has been hit = no fall back was necessaty. -
gm
Input parameter: the usage() method under construction. -
usage_lang
Input parameter: The (human) user language for which the usage methodgm
is under construction. -
defaultLanguage
Input parameter: The preferred fall-back language. Is equal toCompiler.LINGUA_FRANCA
, if at least one entry into this exists. Otherwise arbitrarily chosen from the appearing languages.
-
-
Constructor Details
-
Phase_usage
Phase_usage(GeneratedMethod gm, String usage_lang, String defaultLanguage) Compile the printing of a found text object to the growing method.- Parameters:
usage_lang
- the selected language of the usage method do generate.defaultLanguage
- fall-back if no text version in user_lang exists
-
-
Method Details
-
deliver
Add the text to the method under construction as a Java statement. -
resetTextFound
protected void resetTextFound()starts a new search for a best test. Is called by the callers immediately before calling visit(Element_desc). -
visit
Descend and analyse all containedElement_text
. (There is at least one, due to DTD content definition.) Sets the global registerstextfound
,besttext
, andlanghit
. -
visit
Finds the best fitting explanation translation. Namelyusage_lang
, thendefaultLanguage
, than arbitrary. (Comes here fromVisitor.visit(Element_comment)
explicitly, or fromvisit(Element_desc)
implicitly.
-