|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.model.ParameterValue
@ExportedBean(defaultVisibility=3) public abstract class ParameterValue
A value for a parameter in a build.
Created by ParameterDefinition.createValue(StaplerRequest, JSONObject)
for
a particular build (although this 'owner' build object is passed in for every method
call as a parameter so that the parameter won't have to persist it.)
Instances of ParameterValue
s are persisted into build's build.xml
through XStream (via ParametersAction
), so instances need to be persistable.
ParameterValue
is used to record values of the past build, but
ParameterDefinition
used back then might be gone already, or represent
a different parameter now. So don't try to use the name to infer
ParameterDefinition
is.
ParameterDefinition
,
ParametersAction
,
Serialized FormField Summary | |
---|---|
protected String |
name
|
Constructor Summary | |
---|---|
protected |
ParameterValue(String name)
|
protected |
ParameterValue(String name,
String description)
|
Method Summary | |
---|---|
void |
buildEnvVars(AbstractBuild<?,?> build,
EnvVars env)
Adds environmental variables for the builds to the given map. |
void |
buildEnvVars(AbstractBuild<?,?> build,
Map<String,String> env)
Deprecated. as of 1.344 Use buildEnvVars(AbstractBuild, EnvVars) instead. |
BuildWrapper |
createBuildWrapper(AbstractBuild<?,?> build)
Called at the beginning of a build (but after SCM operations
have taken place) to let a ParameterValue contributes a
BuildWrapper to the build. |
VariableResolver<String> |
createVariableResolver(AbstractBuild<?,?> build)
Returns a VariableResolver so that other components like Builder s
can perform variable substitution to reflect parameter values into the build process. |
boolean |
equals(Object obj)
|
Label |
getAssignedLabel(SubTask task)
Controls where the build (that this parameter is submitted to) will happen. |
ParameterDefinition |
getDefinition()
Deprecated. since 2008-09-20. parameter definition may change any time. So if you find yourself in need of accessing the information from ParameterDefinition ,
instead copy them in ParameterDefinition.createValue(StaplerRequest, JSONObject)
into ParameterValue . |
String |
getDescription()
|
String |
getName()
Name of the parameter. |
String |
getShortDescription()
Computes a human-readable possible-localized one-line description of the parameter value. |
int |
hashCode()
|
boolean |
isSensitive()
Returns whether the information contained in this ParameterValue is sensitive or security related. |
void |
setDescription(String description)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final String name
Constructor Detail |
---|
protected ParameterValue(String name, String description)
protected ParameterValue(String name)
Method Detail |
---|
public String getDescription()
public void setDescription(String description)
@Exported public final String getName()
ParameterValue
among other parameters
for the same build. This must be the same as ParameterDefinition.getName()
.
public void buildEnvVars(AbstractBuild<?,?> build, Map<String,String> env)
buildEnvVars(AbstractBuild, EnvVars)
instead.
This provides a means for a parameter to pass the parameter values to the build to be performed.
When this method is invoked, the map already contains the current "planned export" list. The implementation is expected to add more values to this map (or do nothing)
Environment variables should be by convention all upper case.
(This is so that a Windows/Unix heterogeneous environment
won't get inconsistent result depending on which platform to
execute.) (see EnvVars
why upper casing is a bad idea.)
env
- never null.build
- The build for which this parameter is being used. Never null.public void buildEnvVars(AbstractBuild<?,?> build, EnvVars env)
This provides a means for a parameter to pass the parameter values to the build to be performed.
When this method is invoked, the map already contains the current "planned export" list. The implementation is expected to add more values to this map (or do nothing)
env
- never null.build
- The build for which this parameter is being used. Never null.public BuildWrapper createBuildWrapper(AbstractBuild<?,?> build)
SCM
operations
have taken place) to let a ParameterValue
contributes a
BuildWrapper
to the build.
This provides a means for a parameter to perform more extensive set up / tear down during a build.
build
- The build for which this parameter is being used. Never null.
BuildWrapper
to contribute to.public VariableResolver<String> createVariableResolver(AbstractBuild<?,?> build)
VariableResolver
so that other components like Builder
s
can perform variable substitution to reflect parameter values into the build process.
ParameterValue
can influence
a build.
build
- The build for which this parameter is being used. Never null.
VariableResolver.NONE
.public ParameterDefinition getDefinition()
ParameterDefinition
,
instead copy them in ParameterDefinition.createValue(StaplerRequest, JSONObject)
into ParameterValue
.
ParameterDefinition
is not a good idea.
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public String getShortDescription()
This message is used as a tooltip to describe jobs in the queue. The text should be one line without new line. No HTML allowed (the caller will perform necessary HTML escapes, so any text can be returend.)
public boolean isSensitive()
Subclasses can override this to control the return value.
public Label getAssignedLabel(SubTask task)
AbstractProject.getAssignedLabel()
. If a build is
submitted with multiple parameters, the first one that returns non-null
from this method will win, and all others won't be consulted.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |