hudson.model
Class ChoiceParameterDefinition

java.lang.Object
  extended by hudson.model.ParameterDefinition
      extended by hudson.model.SimpleParameterDefinition
          extended by hudson.model.ChoiceParameterDefinition
All Implemented Interfaces:
ExtensionPoint, Describable<ParameterDefinition>, Serializable

public class ChoiceParameterDefinition
extends SimpleParameterDefinition

Author:
huybrechts
See Also:
Serialized Form

Nested Class Summary
static class ChoiceParameterDefinition.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
ChoiceParameterDefinition(String name, String[] choices, String description)
           
ChoiceParameterDefinition(String name, String choices, String description)
           
 
Method Summary
 ParameterDefinition copyWithDefaultValue(ParameterValue defaultValue)
          Create a new instance of this parameter definition and use the passed parameter value as the default value.
 ParameterValue createValue(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject jo)
          Create a parameter value from a form submission.
 StringParameterValue createValue(String value)
          Creates a ParameterValue from the string representation.
 List<String> getChoices()
           
 String getChoicesText()
           
 StringParameterValue getDefaultParameterValue()
          Returns default parameter value for this definition.
 
Methods inherited from class hudson.model.SimpleParameterDefinition
createValue, createValue
 
Methods inherited from class hudson.model.ParameterDefinition
all, getDescription, getDescriptor, getName, getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChoiceParameterDefinition

@DataBoundConstructor
public ChoiceParameterDefinition(String name,
                                                      String choices,
                                                      String description)

ChoiceParameterDefinition

public ChoiceParameterDefinition(String name,
                                 String[] choices,
                                 String description)
Method Detail

copyWithDefaultValue

public ParameterDefinition copyWithDefaultValue(ParameterValue defaultValue)
Description copied from class: ParameterDefinition
Create a new instance of this parameter definition and use the passed parameter value as the default value.

Overrides:
copyWithDefaultValue in class ParameterDefinition

getChoices

@Exported
public List<String> getChoices()

getChoicesText

public String getChoicesText()

getDefaultParameterValue

public StringParameterValue getDefaultParameterValue()
Description copied from class: ParameterDefinition
Returns default parameter value for this definition.

Overrides:
getDefaultParameterValue in class ParameterDefinition
Returns:
default parameter value or null if no defaults are available

createValue

public ParameterValue createValue(org.kohsuke.stapler.StaplerRequest req,
                                  net.sf.json.JSONObject jo)
Description copied from class: ParameterDefinition
Create a parameter value from a form submission.

This method is invoked when the user fills in the parameter values in the HTML form and submits it to the server.

Specified by:
createValue in class ParameterDefinition

createValue

public StringParameterValue createValue(String value)
Description copied from class: SimpleParameterDefinition
Creates a ParameterValue from the string representation.

Specified by:
createValue in class SimpleParameterDefinition


Copyright © 2004-2013. All Rights Reserved.