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 SummaryNested classes/interfaces inherited from interface hudson.ExtensionPointExtensionPoint.LegacyInstancesAreScopedToHudson
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddBuildVariable(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 registeredAxisDescriptors.intAxis is fully ordered so that we can convert between a list of axis and a string unambiguously.booleangetName()Name of this axis.Possible values for this axis.Used for generating the config UI.inthashCode()intThe inverse ofvalue(int).booleanisSystem()Deprecated.as of 1.373 System vs user difference are generalized into extension point.iterator()static AxisparsePrefixed(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 ofMatrixBuildexecution to allowAxisto updatevaluesbased on the current build.intsize()toString()value(int index) Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, 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
- 
AxisUsed to buildAxisfrom form. Axis with empty values need to be removed later.
 
- 
- 
Method Details- 
isSystemDeprecated.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
- 
sizepublic int size()
- 
value
- 
indexOfThe inverse ofvalue(int).
- 
compareToAxis is fully ordered so that we can convert between a list of axis and a string unambiguously.- Specified by:
- compareToin interface- Comparable<Axis>
 
- 
hashCodepublic int hashCode()
- 
equals
- 
getNameName of this axis. Used as a variable name.
- 
getValuesPossible values for this axis.
- 
rebuildCalled right at the beginning ofMatrixBuildexecution to allowAxisto updatevaluesbased 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 MatrixProjecthas 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 Axisto 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:
- getDescriptorin interface- Describable<Axis>
- Overrides:
- getDescriptorin class- AbstractDescribableImpl<Axis>
 
- 
toString
- 
getValueStringUsed 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.
- 
parsePrefixedParses the submitted form (where possible values are presented as a list of checkboxes) and creates an axis
- 
readResolvePreviously we used to persistAxis, but now those are divided into subtypes. So upon deserialization, resolve to the proper type.
- 
allReturns all the registeredAxisDescriptors.
- 
addBuildVariableConverts the selected value (which is amongvalues) and adds that to the given map, which serves as the build variables.
 
- 
getName()