Package org.biouno.unochoice
Class AbstractCascadableParameter
- java.lang.Object
-
- hudson.model.ParameterDefinition
-
- hudson.model.SimpleParameterDefinition
-
- org.biouno.unochoice.AbstractUnoChoiceParameter
-
- org.biouno.unochoice.AbstractScriptableParameter
-
- org.biouno.unochoice.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:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.ParameterDefinition
ParameterDefinition.ParameterDescriptor
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<Object,Object>parametersMap with parameters in the UI.-
Fields inherited from class org.biouno.unochoice.AbstractScriptableParameter
EQUALS, JENKINS_BUILD_VARIABLE_NAME, JENKINS_PARAMETER_VARIABLE_NAME, JENKINS_PROJECT_VARIABLE_NAME, script, SEPARATOR
-
Fields inherited from class org.biouno.unochoice.AbstractUnoChoiceParameter
DEFAULT_MAX_VISIBLE_ITEM_COUNT, ELEMENT_TYPE_FORMATTED_HIDDEN_HTML, ELEMENT_TYPE_FORMATTED_HTML, ELEMENT_TYPE_ORDERED_LIST, ELEMENT_TYPE_TEXT_BOX, ELEMENT_TYPE_UNORDERED_LIST, LOGGER, PARAMETER_TYPE_CHECK_BOX, PARAMETER_TYPE_MULTI_SELECT, PARAMETER_TYPE_RADIO, PARAMETER_TYPE_SINGLE_SELECT
-
Fields inherited from class hudson.model.ParameterDefinition
LIST
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractCascadableParameter(String name, String description, String randomName, Script script, String referencedParameters)Create a new abstract cascadable parameter.protectedAbstractCascadableParameter(String name, String description, Script script, String referencedParameters)Deprecated.see JENKINS-32149
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoUpdate(String parameters)Exposed to the UI.List<Object>getChoicesForUI()Evaluates a script and returns its result as a Map.Map<Object,Object>getParameters()Gets the current parameters, be it before or after other referenced parameters triggered an update.StringgetReferencedParameters()Gets the list of referenced parameters.String[]getReferencedParametersAsArray()-
Methods inherited from class org.biouno.unochoice.AbstractScriptableParameter
getChoices, getChoices, getChoicesAsString, getChoicesAsString, getDefaultParameterValue, getScript, getVisibleItemCount
-
Methods inherited from class org.biouno.unochoice.AbstractUnoChoiceParameter
all, createValue, createValue, getChoiceType, getDescriptor, getRandomName
-
Methods inherited from class hudson.model.SimpleParameterDefinition
createValue, createValue
-
Methods inherited from class hudson.model.ParameterDefinition
copyWithDefaultValue, getDescription, getFormattedDescription, getName, getType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.biouno.unochoice.ScriptableParameter
getChoices
-
-
-
-
Constructor Detail
-
AbstractCascadableParameter
protected AbstractCascadableParameter(String name, String description, Script script, String referencedParameters)
Deprecated.see JENKINS-32149Create a new abstract cascadable parameter.- Parameters:
name- namedescription- descriptionscript- script used to generate the list of parameter valuesreferencedParameters- 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- namedescription- descriptionrandomName- parameter random generated name (uuid)script- script used to generate the list of parameter valuesreferencedParameters- comma separated list of referenced parameters
-
-
Method Detail
-
getReferencedParameters
public String getReferencedParameters()
Description copied from interface:CascadableParameterGets the list of referenced parameters. If any of these parameters change in the UI we will update our current parameters.- Specified by:
getReferencedParametersin interfaceCascadableParameter<Map<Object,Object>>- Returns:
- the referencedParameters
-
getParameters
public Map<Object,Object> getParameters()
Description copied from class:AbstractScriptableParameterGets 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:
getParametersin classAbstractScriptableParameter- Returns:
- the current parameters with pre-populated defaults
-
doUpdate
@JavaScriptMethod public void doUpdate(String parameters)
Description copied from interface:CascadableParameterExposed to the UI. Is triggered every time any of the referenced parameters gets updated.- Specified by:
doUpdatein interfaceCascadableParameter<Map<Object,Object>>- Parameters:
parameters- Comma separated list of parameters
-
getChoicesForUI
@JavaScriptMethod public List<Object> getChoicesForUI()
Description copied from interface:CascadableParameterEvaluates a script and returns its result as a Map. List values are automatically handled and converted to Maps too.- Specified by:
getChoicesForUIin interfaceCascadableParameter<Map<Object,Object>>- Returns:
- script result as Map
-
getReferencedParametersAsArray
public String[] getReferencedParametersAsArray()
-
-