scijava-common
scijava-common copied to clipboard
Add convenience method to retrieve ScriptInfo/ModuleInfo from script
As suggested by @ctrueden on gitter, we should add a convenience method to ScriptService that returns a ScriptInfo or ModuleInfo for a given script.
Something like getScriptInfo(String filename, String script) ?
As we have:
https://github.com/scijava/scijava-common/blob/dc8ea6d88071d02740ec8e707c9e2cd2cc1ce53c/src/main/java/org/scijava/script/ScriptService.java#L124-L128
already, we might want to keep it consistent and overload the getScript method like this:
/**
* Creates the {@link ScriptInfo} metadata for the provided script.
*/
ScriptInfo getScript(String languageExtension, String script);
Would you be fine with that, @ctrueden? I can submit a PR updating ScriptService and DefaultScriptService then.
Sounds good, @imagejan! :+1: