Package hudson.model
Class SimpleParameterDefinition
- java.lang.Object
-
- hudson.model.ParameterDefinition
-
- hudson.model.SimpleParameterDefinition
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<ParameterDefinition>
,Serializable
- Direct Known Subclasses:
BooleanParameterDefinition
,ChoiceParameterDefinition
,PasswordParameterDefinition
,RunParameterDefinition
,StringParameterDefinition
public abstract class SimpleParameterDefinition extends ParameterDefinition
Convenient base class forParameterDefinition
whose value can be represented in a context-independent single string token.- Author:
- Kohsuke Kawaguchi
- 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 inherited from class hudson.model.ParameterDefinition
LIST
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SimpleParameterDefinition(String name)
protected
SimpleParameterDefinition(String name, String description)
Deprecated.PreferSimpleParameterDefinition(String)
with aDataBoundConstructor
and allowParameterDefinition.setDescription(java.lang.String)
to be used as needed
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ParameterValue
createValue(CLICommand command, String value)
Create a parameter value from the string given in the CLI.abstract ParameterValue
createValue(String value)
Creates aParameterValue
from the string representation.ParameterValue
createValue(org.kohsuke.stapler.StaplerRequest req)
Create a parameter value from a GET with query string.-
Methods inherited from class hudson.model.ParameterDefinition
all, copyWithDefaultValue, createValue, equals, getDefaultParameterValue, getDescription, getDescriptor, getFormattedDescription, getName, getType, hashCode, isValid, setDescription
-
-
-
-
Constructor Detail
-
SimpleParameterDefinition
protected SimpleParameterDefinition(@NonNull String name)
-
SimpleParameterDefinition
@Deprecated protected SimpleParameterDefinition(@NonNull String name, @CheckForNull String description)
Deprecated.PreferSimpleParameterDefinition(String)
with aDataBoundConstructor
and allowParameterDefinition.setDescription(java.lang.String)
to be used as needed
-
-
Method Detail
-
createValue
public abstract ParameterValue createValue(String value)
Creates aParameterValue
from the string representation.
-
createValue
public final ParameterValue createValue(org.kohsuke.stapler.StaplerRequest req)
Description copied from class:ParameterDefinition
Create a parameter value from a GET with query string. If no value is available in the request, it returns a default value if possible, or null.Unlike
ParameterDefinition.createValue(StaplerRequest, JSONObject)
, this method is intended to support the programmatic POST-ing of the build URL. This form is less expressive (as it doesn't support the tree form), but it's more scriptable.If a
ParameterDefinition
can't really support this mode of creating a value, you may just always return null.- Specified by:
createValue
in classParameterDefinition
-
createValue
public final ParameterValue createValue(CLICommand command, String value) throws IOException, InterruptedException
Description copied from class:ParameterDefinition
Create a parameter value from the string given in the CLI.- Overrides:
createValue
in classParameterDefinition
- Parameters:
command
- This is the command that got the parameter.- Throws:
AbortException
- If the CLI processing should be aborted. Hudson will report the error message without stack trace, and then exits this command. Useful for graceful termination.IOException
InterruptedException
-
-