Package ca.phon.query.script
Class QueryScriptLibrary
java.lang.Object
ca.phon.query.script.QueryScriptLibrary
- All Implemented Interfaces:
IExtendable
Script library for phon query scripts.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfindScriptsWithName
(String name) Find scripts with given name in stock and user script locations.findScriptsWithName
(String name, Project project) Find scripts with given name in all script locations.<T> T
getExtension
(Class<T> cap) Get the requested extension if available.Return all extension types supportedpluginScriptFiles
(Project project) projectScriptFiles
(Project project) static String
projectScriptFolder
(Project project) <T> T
putExtension
(Class<T> cap, T impl) Add a new extension.<T> T
removeExtension
(Class<T> cap) Remove a capability.static void
saveScriptToFile
(QueryScript script, String file) Save given script to the specified file
-
Field Details
-
USER_SCRIPT_FOLDER
User script folder
-
-
Constructor Details
-
QueryScriptLibrary
public QueryScriptLibrary()Constructor
-
-
Method Details
-
projectScriptFolder
-
findScriptsWithName
Find scripts with given name in stock and user script locations.- Parameters:
name
- name of script (without extension)- Returns:
-
findScriptsWithName
Find scripts with given name in all script locations. Project is optioal.- Parameters:
name
- name of script (without extension)project
- may benull
- Returns:
-
stockScriptFiles
-
userScriptFiles
-
projectScriptFiles
-
pluginScriptFiles
-
saveScriptToFile
Save given script to the specified file- Parameters:
script
-file
-- Throws:
IOException
-
getExtensions
Description copied from interface:IExtendable
Return all extension types supported- Specified by:
getExtensions
in interfaceIExtendable
-
getExtension
Description copied from interface:IExtendable
Get the requested extension if available.- Specified by:
getExtension
in interfaceIExtendable
- Returns:
- the capability object or
null
if the cability is not available
-
putExtension
Description copied from interface:IExtendable
Add a new extension.- Specified by:
putExtension
in interfaceIExtendable
- Parameters:
cap
- the extension to add- Returns:
- the added extension implementation
-
removeExtension
Description copied from interface:IExtendable
Remove a capability.- Specified by:
removeExtension
in interfaceIExtendable
- Parameters:
cap
- the capability to remove
-