hudson.matrix
Class Axis

java.lang.Object
  extended by hudson.model.AbstractDescribableImpl<Axis>
      extended by hudson.matrix.Axis
All Implemented Interfaces:
ExtensionPoint, Describable<Axis>, Comparable<Axis>, Iterable<String>
Direct Known Subclasses:
JDKAxis, LabelAxis, 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
 
Field Summary
 String name
          Deprecated. as of 1.373 Use getName()
 List<String> values
          Deprecated. as of 1.373 Use getValues()
 
Constructor Summary
Axis(String name, List<String> values)
           
Axis(String name, String... values)
           
Axis(String name, String valueString)
          Used to build Axis from form.
 
Method Summary
 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 DescriptorExtensionList<Axis,AxisDescriptor> all()
          Returns all the registered AxisDescriptors.
 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 o)
           
 AxisDescriptor getDescriptor()
          Gets the descriptor for this instance.
 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 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.
 int size()
           
 String toString()
           
 String value(int index)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public final String name
Deprecated. as of 1.373 Use getName()
Name of this axis. Used as a variable name.


values

public final List<String> values
Deprecated. as of 1.373 Use getValues()
Possible values for this axis.

Constructor Detail

Axis

public Axis(String name,
            List<String> values)

Axis

public Axis(String name,
            String... values)

Axis

@DataBoundConstructor
public Axis(String name,
                                 String valueString)
Used to build Axis from form. Axis with empty values need to be removed later.

Method Detail

isSystem

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 has used to have af special treatment.


iterator

public Iterator<String> iterator()
Specified by:
iterator in interface Iterable<String>

size

public int size()

value

public String value(int index)

indexOf

public int indexOf(String value)
The inverse of value(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 interface Comparable<Axis>

getName

public String getName()
Name of this axis. Used as a variable name.


getValues

public List<String> getValues()
Possible values for this axis.


getDescriptor

public AxisDescriptor getDescriptor()
Description copied from interface: Describable
Gets the descriptor for this instance.

Descriptor is a singleton for every concrete Describable implementation, so if a.getClass()==b.getClass() then a.getDescriptor()==b.getDescriptor() must hold.

Specified by:
getDescriptor in interface Describable<Axis>
Overrides:
getDescriptor in class AbstractDescribableImpl<Axis>

toString

public String toString()
Overrides:
toString in class Object

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 persist Axis, 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 registered AxisDescriptors.


addBuildVariable

public 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.


equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2004-2013 Hudson. All Rights Reserved.