Class MultiselectParameterDefinition
- java.lang.Object
-
- hudson.model.ParameterDefinition
-
- de.westemeyer.plugins.multiselect.MultiselectParameterDefinition
-
- All Implemented Interfaces:
ExtensionPoint,Describable<ParameterDefinition>,Serializable
public class MultiselectParameterDefinition extends ParameterDefinition
The Parameter definition object is responsible for all communication between Jenkins and plugin code.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMultiselectParameterDefinition.DescriptorImpl-
Nested classes/interfaces inherited from class hudson.model.ParameterDefinition
ParameterDefinition.ParameterDescriptor
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.model.ParameterDefinition
LIST
-
-
Constructor Summary
Constructors Constructor Description MultiselectParameterDefinition(String name, String description)Create new parameter definition object.MultiselectParameterDefinition(String name, String description, MultiselectDecisionTree decisionTree, MultiselectConfigurationFormat format)Create new parameter definition object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Queue<Integer>createCoordinates(Integer... coordinates)Create coordinates queue from integer array.MultiselectParameterValuecreateValue(Map<String,Object> jsonObject)Extracted method reduced to use of Map instead of JSONObject for unit tests.ParameterValuecreateValue(org.kohsuke.stapler.StaplerRequest staplerRequest)ParameterValuecreateValue(org.kohsuke.stapler.StaplerRequest staplerRequest, net.sf.json.JSONObject jsonObject)booleanequals(Object o)MultiselectDecisionTreegetDecisionTree()Get decision tree object containing all possible variable combinations.ParameterValuegetDefaultParameterValue()String[]getDependingVariableIds(String selectedId)Method used by JavaScript code to get all combo box ids that depend on content of the given combo box ID.MultiselectConfigurationFormatgetFormat()Get content/parser format.String[]getItemList(Integer[] coordinates)Get item list for AJAX call from config.jelly.StringgetUuid()Get UUID to be used to distinguish JavaScript values for multiple parameters from each other.inthashCode()voidsetDecisionTree(MultiselectDecisionTree decisionTree)Set decision tree object containing all possible variable combinations.voidsetFormat(MultiselectConfigurationFormat format)Set content/parser format.voidsetUuid(String uuid)Set unique ID value.-
Methods inherited from class hudson.model.ParameterDefinition
all, copyWithDefaultValue, createValue, getDescription, getDescriptor, getFormattedDescription, getName, getType, isValid, setDescription
-
-
-
-
Constructor Detail
-
MultiselectParameterDefinition
@DataBoundConstructor public MultiselectParameterDefinition(String name, String description)
Create new parameter definition object.- Parameters:
name- parameter namedescription- parameter description
-
MultiselectParameterDefinition
public MultiselectParameterDefinition(String name, String description, @CheckForNull MultiselectDecisionTree decisionTree, @CheckForNull MultiselectConfigurationFormat format)
Create new parameter definition object.- Parameters:
name- parameter namedescription- parameter descriptiondecisionTree- parsed parameter definitionformat- format, currently only CSV
-
-
Method Detail
-
getItemList
@JavaScriptMethod(name="getItemList") public String[] getItemList(Integer[] coordinates)
Get item list for AJAX call from config.jelly.- Parameters:
coordinates- coordinates in tree, i.e. item indices from columns- Returns:
- array of parameter values for given coordinates
-
getDependingVariableIds
@JavaScriptMethod(name="getDependingVariableIds") public String[] getDependingVariableIds(String selectedId)
Method used by JavaScript code to get all combo box ids that depend on content of the given combo box ID.- Parameters:
selectedId- combo box ID- Returns:
- all combo box ids that depend on content of the given combo box ID
-
createCoordinates
public static Queue<Integer> createCoordinates(Integer... coordinates)
Create coordinates queue from integer array.- Parameters:
coordinates- integer array- Returns:
- queue for use in visitor method
-
getDefaultParameterValue
@Nullable public ParameterValue getDefaultParameterValue()
- Overrides:
getDefaultParameterValuein classParameterDefinition
-
createValue
public ParameterValue createValue(org.kohsuke.stapler.StaplerRequest staplerRequest, net.sf.json.JSONObject jsonObject)
- Specified by:
createValuein classParameterDefinition
-
createValue
public MultiselectParameterValue createValue(Map<String,Object> jsonObject)
Extracted method reduced to use of Map instead of JSONObject for unit tests.- Parameters:
jsonObject- map of parsed json contents- Returns:
- parameter value
-
createValue
public ParameterValue createValue(org.kohsuke.stapler.StaplerRequest staplerRequest)
- Specified by:
createValuein classParameterDefinition
-
getDecisionTree
@CheckForNull public MultiselectDecisionTree getDecisionTree()
Get decision tree object containing all possible variable combinations.- Returns:
- decision tree object containing all possible variable combinations
-
setDecisionTree
@DataBoundSetter public void setDecisionTree(@CheckForNull MultiselectDecisionTree decisionTree)Set decision tree object containing all possible variable combinations.- Parameters:
decisionTree- decision tree object containing all possible variable combinations
-
getFormat
@CheckForNull public MultiselectConfigurationFormat getFormat()
Get content/parser format.- Returns:
- content/parser format
-
setFormat
@DataBoundSetter public void setFormat(@CheckForNull MultiselectConfigurationFormat format)Set content/parser format.- Parameters:
format- content/parser format
-
getUuid
public String getUuid()
Get UUID to be used to distinguish JavaScript values for multiple parameters from each other.- Returns:
- UUID to be used to distinguish JavaScript values for multiple parameters from each other
-
setUuid
public void setUuid(String uuid)
Set unique ID value.- Parameters:
uuid- the new UUID to use for this object
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classParameterDefinition
-
hashCode
public int hashCode()
- Overrides:
hashCodein classParameterDefinition
-
-