Package hudson.model
Class StringParameterDefinition
- java.lang.Object
-
- hudson.model.ParameterDefinition
-
- hudson.model.SimpleParameterDefinition
-
- hudson.model.StringParameterDefinition
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<ParameterDefinition>
,Serializable
- Direct Known Subclasses:
TextParameterDefinition
public class StringParameterDefinition extends SimpleParameterDefinition
Parameter whose value is a string value.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StringParameterDefinition.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 StringParameterDefinition(String name)
StringParameterDefinition(String name, String defaultValue)
StringParameterDefinition(String name, String defaultValue, String description)
StringParameterDefinition(String name, String defaultValue, String description, boolean trim)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ParameterDefinition
copyWithDefaultValue(ParameterValue defaultValue)
Create a new instance of this parameter definition and use the passed parameter value as the default value.ParameterValue
createValue(String str)
Creates aParameterValue
from the string representation.ParameterValue
createValue(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject jo)
Create a parameter value from a form submission.boolean
equals(Object obj)
StringParameterValue
getDefaultParameterValue()
Returns default parameter value for this definition.String
getDefaultValue()
String
getDefaultValue4Build()
int
hashCode()
boolean
isTrim()
void
setDefaultValue(String defaultValue)
void
setTrim(boolean trim)
-
Methods inherited from class hudson.model.SimpleParameterDefinition
createValue, createValue
-
Methods inherited from class hudson.model.ParameterDefinition
all, getDescription, getDescriptor, getFormattedDescription, getName, getType, isValid, setDescription
-
-
-
-
Constructor Detail
-
StringParameterDefinition
@DataBoundConstructor public StringParameterDefinition(@NonNull String name)
- Since:
- 2.281
-
StringParameterDefinition
public StringParameterDefinition(@NonNull String name, @CheckForNull String defaultValue, @CheckForNull String description, boolean trim)
-
StringParameterDefinition
public StringParameterDefinition(@NonNull String name, @CheckForNull String defaultValue, @CheckForNull 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 classParameterDefinition
-
getDefaultValue
@NonNull public String getDefaultValue()
-
getDefaultValue4Build
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public String getDefaultValue4Build()
- Returns:
- original or trimmed defaultValue (depending on trim)
-
setDefaultValue
@DataBoundSetter public void setDefaultValue(@CheckForNull String defaultValue)
-
isTrim
public boolean isTrim()
- Returns:
- trim -
true
, if trim options has been selected, else returnfalse
. Trimming will happen when creatingStringParameterValue
s, the value in the config will not be changed. - Since:
- 2.90
-
setTrim
@DataBoundSetter public void setTrim(boolean trim)
- Since:
- 2.281
-
getDefaultParameterValue
public StringParameterValue getDefaultParameterValue()
Description copied from class:ParameterDefinition
Returns default parameter value for this definition.- Overrides:
getDefaultParameterValue
in classParameterDefinition
- 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 classParameterDefinition
-
createValue
public ParameterValue createValue(String str)
Description copied from class:SimpleParameterDefinition
Creates aParameterValue
from the string representation.- Specified by:
createValue
in classSimpleParameterDefinition
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classParameterDefinition
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classParameterDefinition
-
-