Class Scripting

java.lang.Object
org.bzdev.scripting.Scripting

public class Scripting extends Object
Provide information about the scripting environment. This class provides methods to conveniently look up the official scripting language name, various aliases for those names, and the corresponding file-name extensions (without the '.'). Sets of names and extensions are also provided.

The names are determined when the class is loaded and initialized.

  • Constructor Details

    • Scripting

      public Scripting()
  • Method Details

    • getLanguageNameSet

      public static Set<String> getLanguageNameSet()
      Get a set of the language names for the scripting languages supported on the system. The set returned cannot be modified.
      Returns:
      the set of language names
    • getExtensionSet

      public static Set<String> getExtensionSet()
      Get a set of all the file-name extensions used by scripting languages. The set returned cannot be modified.
      Returns:
      the set of file-name extensions
    • getAliasSet

      public static Set<String> getAliasSet()
      Get a set of the aliases for the language names for each scripting language supported on the system. The set returned cannot be modified.
      Returns:
      the set of aliases
    • getExtensionsByLanguageName

      public static List<String> getExtensionsByLanguageName(String name)
      Get a set of file-name extensions for a given language name. The set returned cannot be modified.
      Parameters:
      name - the language name
      Returns:
      a set of file-name extensions
    • getExtensionsByExtension

      public static List<String> getExtensionsByExtension(String extension)
      Get a set of file-name extensions given one extension. The set returned cannot be modified.
      Parameters:
      extension - a file name extension for a scripting language
      Returns:
      a set of file-name extensions
    • getExtensionsByAlias

      public static List<String> getExtensionsByAlias(String alias)
      Get a set of file-name extensions for a given language-name alias. The set returned cannot be modified.
      Parameters:
      alias - the language-name alias
      Returns:
      a set of file-name extensions
    • getAliasesByLanguageName

      public static List<String> getAliasesByLanguageName(String name)
      Get a set of aliases for a given language name. The set returned cannot be modified.
      Parameters:
      name - the language name
      Returns:
      a set of aliases for the specified language
    • getAliasesByExtension

      public static List<String> getAliasesByExtension(String extension)
      Get a set of aliases for a scripting language with a specified file-name extension. The set returned cannot be modified.
      Parameters:
      extension - the file name extension
      Returns:
      a set of aliases for the specified language
    • getAliasesByAlias

      public static List<String> getAliasesByAlias(String alias)
      Get a set of aliases for a scripting language given one of its aliases. The set returned cannot be modified.
      Parameters:
      alias - an alias
      Returns:
      a set of aliases for the language matching the specified alias
    • getLanguageNameByExtension

      public static String getLanguageNameByExtension(String extension)
      Get the scripting language name given a file-name extension
      Parameters:
      extension - the file-name extension
      Returns:
      the scripting-language name
    • getLanguageNameByAlias

      public static String getLanguageNameByAlias(String alias)
      Get the scripting language name given an alias
      Parameters:
      alias - the alias for the scripting language
      Returns:
      the scripting-language name matching the alias
    • supportsLanguage

      public static boolean supportsLanguage(String languageName)
      Determine if a language is supported given the language name.
      Parameters:
      languageName - the official name for a scripting language
      Returns:
      true if the language is supported ; false otherwise