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:
-
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
Modifier and TypeFieldDescriptionMap 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
ModifierConstructorDescriptionprotected
AbstractCascadableParameter
(String name, String description, String randomName, Script script, String referencedParameters) Create a new abstract cascadable parameter.protected
AbstractCascadableParameter
(String name, String description, Script script, String referencedParameters) Deprecated.see JENKINS-32149 -
Method Summary
Modifier and TypeMethodDescriptionvoid
Exposed to the UI.Evaluates a script and returns its result as a Map.Gets the current parameters, be it before or after other referenced parameters triggered an update.Gets the list of referenced parameters.String[]
Methods inherited from class org.biouno.unochoice.AbstractScriptableParameter
detectProject, 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, equals, getDescription, getFormattedDescription, getName, getType, hashCode, isValid, setDescription
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.biouno.unochoice.ScriptableParameter
getChoices
-
Field Details
-
parameters
Map with parameters in the UI.
-
-
Constructor Details
-
AbstractCascadableParameter
@Deprecated 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 Details
-
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 interfaceCascadableParameter<Map<Object,
Object>> - Returns:
- the referencedParameters
-
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 classAbstractScriptableParameter
- Returns:
- the current parameters with pre-populated defaults
-
doUpdate
Description copied from interface:CascadableParameter
Exposed to the UI. Is triggered every time any of the referenced parameters gets updated.- Specified by:
doUpdate
in interfaceCascadableParameter<Map<Object,
Object>> - Parameters:
parameters
- Comma separated list of parameters
-
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 interfaceCascadableParameter<Map<Object,
Object>> - Returns:
- script result as Map
-
getReferencedParametersAsArray
-