Class QueryScriptLibrary

java.lang.Object
ca.phon.query.script.QueryScriptLibrary
All Implemented Interfaces:
IExtendable

public final class QueryScriptLibrary extends Object implements IExtendable
Script library for phon query scripts.
  • Field Details

    • USER_SCRIPT_FOLDER

      public static final String USER_SCRIPT_FOLDER
      User script folder
  • Constructor Details

    • QueryScriptLibrary

      public QueryScriptLibrary()
      Constructor
  • Method Details

    • projectScriptFolder

      public static String projectScriptFolder(Project project)
    • findScriptsWithName

      public List<QueryScript> findScriptsWithName(String name)
      Find scripts with given name in stock and user script locations.
      Parameters:
      name - name of script (without extension)
      Returns:
    • findScriptsWithName

      public List<QueryScript> findScriptsWithName(String name, Project project)
      Find scripts with given name in all script locations. Project is optioal.
      Parameters:
      name - name of script (without extension)
      project - may be null
      Returns:
    • stockScriptFiles

      public ResourceLoader<QueryScript> stockScriptFiles()
    • userScriptFiles

      public ResourceLoader<QueryScript> userScriptFiles()
    • projectScriptFiles

      public ResourceLoader<QueryScript> projectScriptFiles(Project project)
    • pluginScriptFiles

      public ResourceLoader<QueryScript> pluginScriptFiles(Project project)
    • saveScriptToFile

      public static void saveScriptToFile(QueryScript script, String file) throws IOException
      Save given script to the specified file
      Parameters:
      script -
      file -
      Throws:
      IOException
    • getExtensions

      public Set<Class<?>> getExtensions()
      Description copied from interface: IExtendable
      Return all extension types supported
      Specified by:
      getExtensions in interface IExtendable
    • getExtension

      public <T> T getExtension(Class<T> cap)
      Description copied from interface: IExtendable
      Get the requested extension if available.
      Specified by:
      getExtension in interface IExtendable
      Returns:
      the capability object or null if the cability is not available
    • putExtension

      public <T> T putExtension(Class<T> cap, T impl)
      Description copied from interface: IExtendable
      Add a new extension.
      Specified by:
      putExtension in interface IExtendable
      Parameters:
      cap - the extension to add
      Returns:
      the added extension implementation
    • removeExtension

      public <T> T removeExtension(Class<T> cap)
      Description copied from interface: IExtendable
      Remove a capability.
      Specified by:
      removeExtension in interface IExtendable
      Parameters:
      cap - the capability to remove