Class Axis
- All Implemented Interfaces:
ExtensionPoint
,Describable<Axis>
,Comparable<Axis>
,Iterable<String>
- Direct Known Subclasses:
JDKAxis
,LabelAxis
,LabelExpAxis
,TextAxis
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
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.all()
Returns all the registeredAxisDescriptor
s.int
Axis is fully ordered so that we can convert between a list of axis and a string unambiguously.boolean
getName()
Name of this axis.Possible values for this axis.Used for generating the config UI.int
hashCode()
int
The inverse ofvalue(int)
.boolean
isSystem()
Deprecated.as of 1.373 System vs user difference are generalized into extension point.iterator()
static Axis
parsePrefixed
(org.kohsuke.stapler.StaplerRequest2 req, String name) Parses the submitted form (where possible values are presented as a list of checkboxes) and creates an axisPreviously we used to persistAxis
, but now those are divided into subtypes.rebuild
(MatrixBuild.MatrixBuildExecution context) Called right at the beginning ofMatrixBuild
execution to allowAxis
to updatevalues
based on the current build.int
size()
toString()
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 Details
-
name
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public final String nameDeprecated.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> valuesDeprecated.as of 1.373 UsegetValues()
Possible values for this axis.
-
-
Constructor Details
-
Axis
-
Axis
-
Axis
Used to buildAxis
from form. Axis with empty values need to be removed later.
-
-
Method Details
-
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. -
iterator
-
size
public int size() -
value
-
indexOf
The inverse ofvalue(int)
. -
compareTo
Axis is fully ordered so that we can convert between a list of axis and a string unambiguously.- Specified by:
compareTo
in interfaceComparable<Axis>
-
hashCode
public int hashCode() -
equals
-
getName
Name of this axis. Used as a variable name. -
getValues
Possible values for this axis. -
rebuild
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
- Specified by:
getDescriptor
in interfaceDescribable<Axis>
- Overrides:
getDescriptor
in classAbstractDescribableImpl<Axis>
-
toString
-
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
Parses the submitted form (where possible values are presented as a list of checkboxes) and creates an axis -
readResolve
Previously we used to persistAxis
, but now those are divided into subtypes. So upon deserialization, resolve to the proper type. -
all
Returns all the registeredAxisDescriptor
s. -
addBuildVariable
Converts the selected value (which is amongvalues
) and adds that to the given map, which serves as the build variables.
-
getName()