Class Axis
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<Axis>
-
- hudson.matrix.Axis
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<Axis>
,Comparable<Axis>
,Iterable<String>
- Direct Known Subclasses:
JDKAxis
,LabelAxis
,LabelExpAxis
,TextAxis
public class Axis extends AbstractDescribableImpl<Axis> implements Comparable<Axis>, Iterable<String>, ExtensionPoint
Configuration axis.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.
- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addBuildVariable(String value, Map<String,String> map)
Converts the selected value (which is amongvalues
) and adds that to the given map, which serves as the build variables.static DescriptorExtensionList<Axis,AxisDescriptor>
all()
Returns all the registeredAxisDescriptor
s.int
compareTo(Axis that)
Axis is fully ordered so that we can convert between a list of axis and a string unambiguously.boolean
equals(Object obj)
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
hashCode()
int
indexOf(String value)
The inverse ofvalue(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 axisObject
readResolve()
Previously we used to persistAxis
, but now those are divided into subtypes.List<String>
rebuild(MatrixBuild.MatrixBuildExecution context)
Called right at the beginning ofMatrixBuild
execution to allowAxis
to updatevalues
based on the current build.int
size()
String
toString()
String
value(int index)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
name
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public final String name
Deprecated.as of 1.373 UsegetName()
Name of this axis. Used as a variable name.
-
values
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("1.463") public final List<String> values
Deprecated.as of 1.373 UsegetValues()
Possible values for this axis.
-
-
Method Detail
-
isSystem
@Deprecated public boolean isSystem()
Deprecated.as of 1.373 System vs user difference are generalized into extension point.Returns true if this axis is a system-reserved axis that used to have special treatment.
-
size
public int size()
-
value
public String value(int index)
-
indexOf
public int indexOf(String value)
The inverse ofvalue(int)
.
-
compareTo
public int compareTo(Axis that)
Axis is fully ordered so that we can convert between a list of axis and a string unambiguously.- Specified by:
compareTo
in interfaceComparable<Axis>
-
getName
public String getName()
Name of this axis. Used as a variable name.
-
rebuild
public List<String> rebuild(MatrixBuild.MatrixBuildExecution context)
Called right at the beginning ofMatrixBuild
execution to allowAxis
to updatevalues
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 thegetValues()
(which is typically done by updatingvalues
.)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).- Parameters:
context
- The ongoing build. Never null.- Returns:
- Never null. Returns the updated set of values.
- Since:
- 1.471
-
getDescriptor
public AxisDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<Axis>
- Overrides:
getDescriptor
in classAbstractDescribableImpl<Axis>
-
getValueString
public String getValueString()
Used for generating the config UI. If the axis is big and occupies a lot of space, use newline for separator to display multi-line text.
-
parsePrefixed
public 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
-
readResolve
public Object readResolve()
Previously we used to persistAxis
, but now those are divided into subtypes. So upon deserialization, resolve to the proper type.
-
all
public static DescriptorExtensionList<Axis,AxisDescriptor> all()
Returns all the registeredAxisDescriptor
s.
-
-