Package org.graalvm.launcher
Class LanguageLauncherBase
java.lang.Object
org.graalvm.launcher.Launcher
org.graalvm.launcher.LanguageLauncherBase
- Direct Known Subclasses:
AbstractLanguageLauncher,PolyglotLauncher
Base implementation for polyglot-aware languages and tools. Prints additional language-related
help items, prints installed engine's options.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.graalvm.launcher.Launcher
Launcher.AbortException, Launcher.OS, Launcher.VersionAction, Launcher.VMType -
Field Summary
Fields inherited from class org.graalvm.launcher.Launcher
LAUNCHER_OPTIONS_INDENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidcollectArguments(Set<String> options) Add all known arguments to theoptionslist.protected org.graalvm.options.OptionDescriptorfindOptionDescriptor(String group, String key) Finds the a descriptor for the option.protected voidmaybePrintAdditionalHelp(org.graalvm.options.OptionCategory helpCategory) Should print tool-specific help.protected booleanparseCommonOption(String defaultOptionPrefix, Map<String, String> polyglotOptions, boolean experimentalOptions, String arg) Parses an option, returning success.protected voidprintDefaultHelp(org.graalvm.options.OptionCategory helpCategory) Prints default help text.protected voidPrints version information about all known languages and instruments on stdout.protected booleanRuns launcher's action as version print or help.Methods inherited from class org.graalvm.launcher.Launcher
abort, abort, abort, abort, abort, abort, abortInvalidArgument, abortInvalidArgument, abortUnrecognizedArgument, canPolyglot, executeJVM, executeJVM, executePolyglot, executePolyglot, exit, exit, getDefaultVMType, getError, getGraalVMBinaryPath, getGraalVMHome, getLogFile, getMainClass, getOutput, getProgramName, isAOT, isGraalVMAvailable, isStandalone, isTTY, launcherOption, maybeNativeExec, maybeNativeExec, newLogStream, parseUnrecognizedOptions, printHelp, println, println, printOtherHelpCategory, printVersion, setError, setOptionIndent, setOutput, warn, warn
-
Constructor Details
-
LanguageLauncherBase
public LanguageLauncherBase()
-
-
Method Details
-
argumentsProcessingDone
protected void argumentsProcessingDone() -
runLauncherAction
protected boolean runLauncherAction()Description copied from class:LauncherRuns launcher's action as version print or help. Returnstrue, if the execution should terminate, e.g. after printing help.Launcher.parseCommonOption(java.lang.String, java.util.Map<java.lang.String, java.lang.String>, boolean, java.lang.String)should be called for commandline argument(s) prior to this method to set up flags to display help etc.- Overrides:
runLauncherActionin classLauncher- Returns:
truewhen execution should be terminated.
-
parseCommonOption
protected boolean parseCommonOption(String defaultOptionPrefix, Map<String, String> polyglotOptions, boolean experimentalOptions, String arg) Description copied from class:LauncherParses an option, returning success. The method is called to parse `arg` option from the commandline, not recognized by the application. The method may contribute to the `polyglotOptions` (in/out parameter, modifiable) to alter polyglot behaviour. If the option is recognized, the method must returntrue.- Overrides:
parseCommonOptionin classLauncher- Parameters:
defaultOptionPrefix- default prefix for the option names, derived from the launching application.polyglotOptions- options for polyglot engineexperimentalOptions- true, if experimental options are explicitly allowedarg- argument to parse- Returns:
- true, if the option was recognized.
-
printDefaultHelp
protected void printDefaultHelp(org.graalvm.options.OptionCategory helpCategory) Description copied from class:LauncherPrints default help text. Prints options, starting with tool specific options. Launcher implementations can override to provide launcher-specific intro / summary.- Overrides:
printDefaultHelpin classLauncher- Parameters:
helpCategory- options category to print.
-
maybePrintAdditionalHelp
protected void maybePrintAdditionalHelp(org.graalvm.options.OptionCategory helpCategory) Description copied from class:LauncherShould print tool-specific help. Regular languages print info on the installed tools and languages. The default implementation prints nothing.- Overrides:
maybePrintAdditionalHelpin classLauncher- Parameters:
helpCategory- category of options to print
-
printPolyglotVersions
protected void printPolyglotVersions()Prints version information about all known languages and instruments on stdout. -
findOptionDescriptor
Description copied from class:LauncherFinds the a descriptor for the option.- Specified by:
findOptionDescriptorin classLauncher- Parameters:
group- option groupkey- the option name (including the group)- Returns:
- descriptor or
null.
-
collectArguments
Description copied from class:LauncherAdd all known arguments to theoptionslist.- Specified by:
collectArgumentsin classLauncher- Parameters:
options- list to which valid arguments must be added.
-