Interface ScriptBinding
-
- All Known Implementing Classes:
CmsScriptBinding
,RepositoryScriptBinding
,RuntimeScriptBinding
,StaticConfigurableScriptBinding
,WebScriptBinding
public interface ScriptBinding
This interface describes a console data, variables and functions. Each implementation of this interface will enhance the console, by providing additional variables and functions that can be used in scripts.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cleanVariables(Map<String,Object> variables)
Allows clean up of variables created during the getVariables call.String
getFunctions()
Returns the JavaScript functions to inject at the start of the script, in the form of a single String prepended to the script.Map<String,ScriptBindingDocumentation>
getFunctionsDescriptions()
Returns the list of functions descriptions, mapped by function name.Map<I18nizableText,ScriptBindingDocumentation>
getTutorials()
Returns the list of tutorialsMap<String,Object>
getVariables(ScriptExecArguments execArgs)
Returns the list of variables this ScriptBinding provides, mapped by variable name.Map<String,ScriptBindingDocumentation>
getVariablesDescriptions()
Returns the list of variables descriptions, mapped by variable name.String
getVariablesScripts()
Returns the JavaScript variables script to inject at the start of the script, in the form of a single String prepended to the script.Pattern
getWorkspacePattern()
Return the pattern of the workspace corresponding to this script binding.
-
-
-
Method Detail
-
getWorkspacePattern
Pattern getWorkspacePattern()
Return the pattern of the workspace corresponding to this script binding.- Returns:
- The pattern to match
-
getVariables
Map<String,Object> getVariables(ScriptExecArguments execArgs)
Returns the list of variables this ScriptBinding provides, mapped by variable name.- Parameters:
execArgs
- The The arguments for script execution- Returns:
- The list of variables, or null if no variable is provided.
-
getVariablesScripts
String getVariablesScripts()
Returns the JavaScript variables script to inject at the start of the script, in the form of a single String prepended to the script.- Returns:
- The functions text, or null if no function is provided.
-
getVariablesDescriptions
Map<String,ScriptBindingDocumentation> getVariablesDescriptions()
Returns the list of variables descriptions, mapped by variable name. This list does not have to match the getVariables return value, but the description is used to inform the user of the existence and usability of each variable.- Returns:
- The list of variables descriptions, or null if no description is provided.
-
cleanVariables
void cleanVariables(Map<String,Object> variables)
Allows clean up of variables created during the getVariables call.- Parameters:
variables
- The map of variables.
-
getFunctions
String getFunctions()
Returns the JavaScript functions to inject at the start of the script, in the form of a single String prepended to the script.- Returns:
- The functions text, or null if no function is provided.
-
getFunctionsDescriptions
Map<String,ScriptBindingDocumentation> getFunctionsDescriptions()
Returns the list of functions descriptions, mapped by function name. This list does not have to match the functions returned by getFunctions, but the description is used to inform the user of the existence and usability of each function.- Returns:
- The list of functions descriptions, or null if no description is provided.
-
getTutorials
Map<I18nizableText,ScriptBindingDocumentation> getTutorials()
Returns the list of tutorials- Returns:
- The list of tutorials, or null if no tutorial is provided.
-
-