@ExportedBean public class ParametersAction extends Object implements Action, Iterable<ParameterValue>, Queue.QueueAction, EnvironmentContributingAction, LabelAssignmentAction
This object is associated with the build record so that we remember what parameters were used for what build. It is also attached to the queue item to remember parameter that were specified when scheduling.
Constructor and Description |
---|
ParametersAction(List<ParameterValue> parameters) |
ParametersAction(ParameterValue... parameters) |
Modifier and Type | Method and Description |
---|---|
void |
buildEnvVars(AbstractBuild<?,?> build,
EnvVars env)
Called by
AbstractBuild to allow plugins to contribute environment variables. |
void |
createBuildWrappers(AbstractBuild<?,?> build,
Collection<? super BuildWrapper> result) |
ParametersAction |
createUpdated(Collection<? extends ParameterValue> overrides)
Creates a new
ParametersAction that contains all the parameters in this action
with the overrides / new values given as parameters. |
VariableResolver<String> |
createVariableResolver(AbstractBuild<?,?> build)
Creates an
VariableResolver that aggregates all the parameters. |
Label |
getAssignedLabel(SubTask task)
Reassigns where the task gets run.
|
String |
getDisplayName()
Gets the string to be displayed.
|
String |
getIconFileName()
Gets the file name of the icon.
|
ParameterValue |
getParameter(String name) |
List<ParameterValue> |
getParameters() |
String |
getUrlName()
Gets the URL path name.
|
Iterator<ParameterValue> |
iterator() |
ParametersAction |
merge(ParametersAction overrides) |
boolean |
shouldSchedule(List<Action> actions)
Allow an other build of the same project to be scheduled, if it has other parameters.
|
String |
substitute(AbstractBuild<?,?> build,
String text)
Performs a variable substitution to the given text and return it.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public ParametersAction(List<ParameterValue> parameters)
public ParametersAction(ParameterValue... parameters)
public void createBuildWrappers(AbstractBuild<?,?> build, Collection<? super BuildWrapper> result)
public void buildEnvVars(AbstractBuild<?,?> build, EnvVars env)
EnvironmentContributingAction
AbstractBuild
to allow plugins to contribute environment variables.buildEnvVars
in interface EnvironmentContributingAction
build
- The calling build. Never null.env
- Environment variables should be added to this map.public String substitute(AbstractBuild<?,?> build, String text)
public VariableResolver<String> createVariableResolver(AbstractBuild<?,?> build)
VariableResolver
that aggregates all the parameters.
If you are a BuildStep
, most likely you should call AbstractBuild.getBuildVariableResolver()
.
public Iterator<ParameterValue> iterator()
iterator
in interface Iterable<ParameterValue>
@Exported(visibility=2) public List<ParameterValue> getParameters()
public ParameterValue getParameter(String name)
public Label getAssignedLabel(SubTask task)
LabelAssignmentAction
getAssignedLabel
in interface LabelAssignmentAction
task
- Never null.LabelAssignmentAction
s take control, eventually to SubTask#getAssignedLabel()
.
If non-null value is returned, that label will be authoritative.public String getDisplayName()
Action
getDisplayName
in interface Action
getDisplayName
in interface ModelObject
public String getIconFileName()
Action
getIconFileName
in interface Action
If an absolute file name that starts from '/' is returned (like "/plugin/foo/abc.gif'), then it will be interpreted as a path from the context root of Jenkins. This is useful to pick up image files from a plugin.
Finally, return null to hide it from the task list. This is normally not very useful, but this can be used for actions that only contribute floatBox.jelly and no task list item. The other case where this is useful is to avoid showing links that require a privilege when the user is anonymous.
Functions.isAnonymous()
,
Functions.getIconFilePath(Action)
public String getUrlName()
Action
For example, if this method returns "xyz", and if the parent object (that this action is associated with) is bound to /foo/bar/zot, then this action object will be exposed to /foo/bar/zot/xyz.
This method should return a string that's unique among other Action
s.
The returned string can be an absolute URL, like "http://www.sun.com/", which is useful for directly connecting to external systems.
If the returned string starts with '/', like '/foo', then it's assumed to be relative to the context path of the Jenkins webapp.
getUrlName
in interface Action
Action.getIconFileName()
.Functions.getActionUrl(String, Action)
public boolean shouldSchedule(List<Action> actions)
shouldSchedule
in interface Queue.QueueAction
@Nonnull public ParametersAction createUpdated(Collection<? extends ParameterValue> overrides)
ParametersAction
that contains all the parameters in this action
with the overrides / new values given as parameters.ParametersAction
. The result may contain null ParameterValue
s@Nonnull public ParametersAction merge(@CheckForNull ParametersAction overrides)
Copyright © 2014. All rights reserved.