public class Axis extends hudson.model.AbstractDescribableImpl<Axis> implements Comparable<Axis>, Iterable<String>, hudson.ExtensionPoint
This class represents a single dimension of the configuration matrix. For example, the JAX-WS RI test configuration might include one axis "container={glassfish,tomcat,jetty}" and another axis "stax={sjsxp,woodstox}", and so on.
Modifier and Type | Field and Description |
---|---|
String |
name
Deprecated.
as of 1.373
Use
getName() |
List<String> |
values
Deprecated.
as of 1.373
Use
getValues() |
Constructor and Description |
---|
Axis(String name,
List<String> values) |
Axis(String name,
String... values) |
Axis(String name,
String valueString)
Used to build
Axis from form. |
Modifier and Type | Method and Description |
---|---|
void |
addBuildVariable(String value,
Map<String,String> map)
Converts the selected value (which is among
values ) and adds that to the given map,
which serves as the build variables. |
static hudson.DescriptorExtensionList<Axis,AxisDescriptor> |
all()
Returns all the registered
AxisDescriptor s. |
int |
compareTo(Axis that)
Axis is fully ordered so that we can convert between a list of axis
and a string unambiguously.
|
AxisDescriptor |
getDescriptor() |
String |
getName()
Name of this axis.
|
List<String> |
getValues()
Possible values for this axis.
|
String |
getValueString()
Used for generating the config UI.
|
int |
indexOf(String value)
The inverse of
value(int) . |
boolean |
isSystem()
Deprecated.
as of 1.373
System vs user difference are generalized into extension point.
|
Iterator<String> |
iterator() |
static Axis |
parsePrefixed(org.kohsuke.stapler.StaplerRequest req,
String name)
Parses the submitted form (where possible values are
presented as a list of checkboxes) and creates an axis
|
Object |
readResolve()
Previously we used to persist
Axis , but now those are divided into subtypes. |
List<String> |
rebuild(MatrixBuild.MatrixBuildExecution context)
Called right at the beginning of
MatrixBuild execution to allow Axis to update values
based on the current build. |
int |
size() |
String |
toString() |
String |
value(int index) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public final String name
getName()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince(value="1.463") public final List<String> values
getValues()
public boolean isSystem()
public int size()
public String value(int index)
public int indexOf(String value)
value(int)
.public int compareTo(Axis that)
compareTo
in interface Comparable<Axis>
public String getName()
public List<String> rebuild(MatrixBuild.MatrixBuildExecution context)
MatrixBuild
execution to allow Axis
to update values
based on the current build.
Historically, axes values are considered static. They were assumed to reflect what the user has typed in,
and their values are changed only when the project is reconfigured. So abstractions are built around this
notion, and so for example MatrixProject
has the current axes and their values, which it uses
to render its UI.
So when the need was identified to change the values of axes per build, we decided that this be represented
as a kind of project configuration update (where a project gets reconfigured every time a build runs), and
this call back was added to allow Axis
to update the next return value from the getValues()
(which is typically done by updating values
.)
While it is not strictly required, because of these historical reasons, UI will look better if
Future calls to getValues()
return the same values as what this method returns (until
the next rebuild call).
context
- The ongoing build. Never null.public AxisDescriptor getDescriptor()
public String getValueString()
public static Axis parsePrefixed(org.kohsuke.stapler.StaplerRequest req, String name)
public Object readResolve()
Axis
, but now those are divided into subtypes.
So upon deserialization, resolve to the proper type.public static hudson.DescriptorExtensionList<Axis,AxisDescriptor> all()
AxisDescriptor
s.Copyright © 2014. All rights reserved.