Class LanguageLauncherBase

java.lang.Object
org.graalvm.launcher.Launcher
org.graalvm.launcher.LanguageLauncherBase
Direct Known Subclasses:
AbstractLanguageLauncher, PolyglotLauncher

public abstract class LanguageLauncherBase extends Launcher
Base implementation for polyglot-aware languages and tools. Prints additional language-related help items, prints installed engine's options.
  • Constructor Details

    • LanguageLauncherBase

      public LanguageLauncherBase()
  • Method Details

    • argumentsProcessingDone

      protected void argumentsProcessingDone()
    • runLauncherAction

      protected boolean runLauncherAction()
      Description copied from class: Launcher
      Runs launcher's action as version print or help. Returns true, 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:
      runLauncherAction in class Launcher
      Returns:
      true when execution should be terminated.
    • parseCommonOption

      protected boolean parseCommonOption(String defaultOptionPrefix, Map<String,String> polyglotOptions, boolean experimentalOptions, String arg)
      Description copied from class: Launcher
      Parses 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 return true.
      Overrides:
      parseCommonOption in class Launcher
      Parameters:
      defaultOptionPrefix - default prefix for the option names, derived from the launching application.
      polyglotOptions - options for polyglot engine
      experimentalOptions - true, if experimental options are explicitly allowed
      arg - argument to parse
      Returns:
      true, if the option was recognized.
    • printDefaultHelp

      protected void printDefaultHelp(org.graalvm.options.OptionCategory helpCategory)
      Description copied from class: Launcher
      Prints default help text. Prints options, starting with tool specific options. Launcher implementations can override to provide launcher-specific intro / summary.
      Overrides:
      printDefaultHelp in class Launcher
      Parameters:
      helpCategory - options category to print.
    • maybePrintAdditionalHelp

      protected void maybePrintAdditionalHelp(org.graalvm.options.OptionCategory helpCategory)
      Description copied from class: Launcher
      Should print tool-specific help. Regular languages print info on the installed tools and languages. The default implementation prints nothing.
      Overrides:
      maybePrintAdditionalHelp in class Launcher
      Parameters:
      helpCategory - category of options to print
    • printPolyglotVersions

      protected void printPolyglotVersions()
      Prints version information about all known languages and instruments on stdout.
    • findOptionDescriptor

      protected org.graalvm.options.OptionDescriptor findOptionDescriptor(String group, String key)
      Description copied from class: Launcher
      Finds the a descriptor for the option.
      Specified by:
      findOptionDescriptor in class Launcher
      Parameters:
      group - option group
      key - the option name (including the group)
      Returns:
      descriptor or null.
    • collectArguments

      protected void collectArguments(Set<String> options)
      Description copied from class: Launcher
      Add all known arguments to the options list.
      Specified by:
      collectArguments in class Launcher
      Parameters:
      options - list to which valid arguments must be added.