Class AbstractCascadableParameter

All Implemented Interfaces:
ExtensionPoint, Describable<ParameterDefinition>, Serializable, CascadableParameter<Map<Object,Object>>, ScriptableParameter<Map<Object,Object>>, UnoChoiceParameter
Direct Known Subclasses:
CascadeChoiceParameter, DynamicReferenceParameter

public abstract class AbstractCascadableParameter extends AbstractScriptableParameter implements CascadableParameter<Map<Object,Object>>
Base class for cascadable parameters, providing basic and utility methods.
Since:
0.20
Author:
Bruno P. Kinoshita
See Also:
  • Field Details

    • parameters

      protected final Map<Object,Object> parameters
      Map with parameters in the UI.
  • Constructor Details

    • AbstractCascadableParameter

      @Deprecated protected AbstractCascadableParameter(String name, String description, Script script, String referencedParameters)
      Deprecated.
      see JENKINS-32149
      Create a new abstract cascadable parameter.
      Parameters:
      name - name
      description - description
      script - script used to generate the list of parameter values
      referencedParameters - comma separated list of referenced parameters
    • AbstractCascadableParameter

      protected AbstractCascadableParameter(String name, String description, String randomName, Script script, String referencedParameters)
      Create a new abstract cascadable parameter.
      Parameters:
      name - name
      description - description
      randomName - parameter random generated name (uuid)
      script - script used to generate the list of parameter values
      referencedParameters - comma separated list of referenced parameters
  • Method Details

    • getReferencedParameters

      public String getReferencedParameters()
      Description copied from interface: CascadableParameter
      Gets the list of referenced parameters. If any of these parameters change in the UI we will update our current parameters.
      Specified by:
      getReferencedParameters in interface CascadableParameter<Map<Object,Object>>
      Returns:
      the referencedParameters
    • getParameters

      public Map<Object,Object> getParameters()
      Description copied from class: AbstractScriptableParameter
      Gets the current parameters, be it before or after other referenced parameters triggered an update. Populates parameters common to all evaluations, such as jenkinsProject, which is the current Jenkins project.
      Overrides:
      getParameters in class AbstractScriptableParameter
      Returns:
      the current parameters with pre-populated defaults
    • doUpdate

      @JavaScriptMethod public void doUpdate(String parameters)
      Description copied from interface: CascadableParameter
      Exposed to the UI. Is triggered every time any of the referenced parameters gets updated.
      Specified by:
      doUpdate in interface CascadableParameter<Map<Object,Object>>
      Parameters:
      parameters - Comma separated list of parameters
    • getChoicesForUI

      @JavaScriptMethod public List<Object> getChoicesForUI()
      Description copied from interface: CascadableParameter
      Evaluates a script and returns its result as a Map. List values are automatically handled and converted to Maps too.
      Specified by:
      getChoicesForUI in interface CascadableParameter<Map<Object,Object>>
      Returns:
      script result as Map
    • getReferencedParametersAsArray

      public String[] getReferencedParametersAsArray()