Class ScriptlerScript

java.lang.Object
org.biouno.unochoice.model.AbstractScript
org.biouno.unochoice.model.ScriptlerScript
All Implemented Interfaces:
Describable<AbstractScript>, Serializable, Script

public class ScriptlerScript extends AbstractScript
A scriptler script.
Since:
0.1
Author:
Bruno P. Kinoshita
See Also:
  • Constructor Details

    • ScriptlerScript

      @DataBoundConstructor public ScriptlerScript(org.jenkinsci.plugins.scriptler.builder.ScriptlerBuilder scriptlerBuilder, Boolean isSandboxed)
      Parameters:
      scriptlerBuilder - Scriptler builder
      isSandboxed - whether this script must be sandboxed or not
  • Method Details

    • readResolve

      public Object readResolve()
    • getScriptlerBuilder

      public org.jenkinsci.plugins.scriptler.builder.ScriptlerBuilder getScriptlerBuilder()
      Returns:
      the Scriptler builder
    • getScriptlerScriptId

      public String getScriptlerScriptId()
      Returns:
      the scriptler script ID
    • setScriptlerScriptId

      @DataBoundSetter public void setScriptlerScriptId(String scriptlerScriptId)
    • getParameters

      public Map<String,String> getParameters()
      Returns:
      the parameters
    • setParameters

      @DataBoundSetter public void setParameters(List<Map<String,String>> parametersList)
    • getIsSandboxed

      public Boolean getIsSandboxed()
      Returns:
      the sandbox flag
    • eval

      public Object eval()
      Description copied from interface: Script
      Evaluates the script.
      Returns:
      output of the script
    • eval

      public Object eval(Map<String,String> parameters)
      Description copied from interface: Script
      Evaluates the script using the given parameters binding parameters.
      Parameters:
      parameters - binding parameters
      Returns:
      output of the script
    • toGroovyScript

      public GroovyScript toGroovyScript()
      Converts this scriptler script to a GroovyScript. The script will run in the Groovy Sandbox environment by default, unless approved by a Jenkins administrator. In this case it won't use the Groovy Sandbox. This is useful if the Groovy script needs access to API not available in the Sandbox (e.g. Grapes).
      Returns:
      a GroovyScript