Class ScriptLanguageProvider

java.lang.Object
qupath.lib.gui.scripting.languages.ScriptLanguageProvider

public class ScriptLanguageProvider extends Object
Class with static methods to fetch all the available ScriptLanguages.
Since:
v0.4.0
Author:
Melvin Gelbard, Pete Bankhead
  • Constructor Details

    • ScriptLanguageProvider

      public ScriptLanguageProvider()
  • Method Details

    • getAvailableLanguages

      public static Collection<ScriptLanguage> getAvailableLanguages()
      Get the available script languages.
      Returns:
    • getLanguageFromName

      public static ScriptLanguage getLanguageFromName(String name)
      Given a file name, determine the associated language - or null if no suitable (supported) language can be found.
      Parameters:
      name -
      Returns:
    • fromString

      public static ScriptLanguage fromString(String languageString)
      Get the ScriptLanguage object corresponding to the specified String. If the string cannot be matched, PlainLanguage is returned.
      Parameters:
      languageString -
      Returns:
      corresponding script language, or PlainLanguage if no match
    • getLanguageFromExtension

      public static ScriptLanguage getLanguageFromExtension(String ext)
      Return the first ScriptLanguage compatible with the specified extension (can be runnable or not).
      Parameters:
      ext - the extension of the script file
      Returns:
      compatible script language
    • getEngineByName

      public static ScriptEngine getEngineByName(String languageName)
      Get the ScriptEngine based on its name.
      Parameters:
      languageName -
      Returns:
      script engine