Class ScriptLanguageProvider
java.lang.Object
qupath.lib.gui.scripting.languages.ScriptLanguageProvider
Class with static methods to fetch all the available ScriptLanguages.
- Since:
- v0.4.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ScriptLanguage
fromString
(String languageString) Get theScriptLanguage
object corresponding to the specified String.static Collection
<ScriptLanguage> Get the available script languages.static ScriptEngine
getEngineByName
(String languageName) Get theScriptEngine
based on its name.static ScriptLanguage
Return the firstScriptLanguage
compatible with the specified extension (can be runnable or not).static ScriptLanguage
getLanguageFromName
(String name) Given a file name, determine the associated language - or null if no suitable (supported) language can be found.static boolean
installLanguage
(ScriptLanguage language) Install a new script language.
-
Constructor Details
-
ScriptLanguageProvider
public ScriptLanguageProvider()
-
-
Method Details
-
getAvailableLanguages
Get the available script languages.- Returns:
-
getLanguageFromName
Given a file name, determine the associated language - or null if no suitable (supported) language can be found.- Parameters:
name
-- Returns:
-
fromString
Get theScriptLanguage
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
Return the firstScriptLanguage
compatible with the specified extension (can be runnable or not).- Parameters:
ext
- the extension of the script file- Returns:
- compatible script language
-
installLanguage
Install a new script language.- Parameters:
language
- the language to install- Returns:
- true if the language was installed, false otherwise (e.g. it was already installed)
-
getEngineByName
Get theScriptEngine
based on its name.- Parameters:
languageName
-- Returns:
- script engine
-