hudson.model.labels
Class LabelAtom

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.model.Actionable
          extended by hudson.model.Label
              extended by hudson.model.labels.LabelAtom
All Implemented Interfaces:
ModelObject, Saveable, SearchableModelObject, SearchItem, Comparable<Label>

public class LabelAtom
extends Label
implements Saveable

Atomic single token label, like "foo" or "bar".

Since:
1.372
Author:
Kohsuke Kawaguchi

Nested Class Summary
 
Nested classes/interfaces inherited from class hudson.model.Label
Label.ConverterImpl
 
Field Summary
 
Fields inherited from class hudson.model.Label
loadStatistics, nodeProvisioner
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
LabelAtom(String name)
           
 
Method Summary
 void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Accepts the update to the node configuration.
static String escape(String name)
           
static LabelAtom get(String l)
          Obtains an atom by its name.
 List<Action> getActions()
          Gets actions contributed to this build.
 List<LabelAtomPropertyDescriptor> getApplicablePropertyDescriptors()
          Returns all the LabelAtomPropertyDescriptors that can be potentially configured on this label.
 String getExpression()
          If the label contains 'unsafe' chars, escape them.
 DescribableList<LabelAtomProperty,LabelAtomPropertyDescriptor> getProperties()
          Properties associated with this label.
 List<LabelAtomProperty> getPropertiesList()
           
 void load()
           
 boolean matches(VariableResolver<Boolean> resolver)
          Evaluates whether the label expression is true given the specified value assignment.
static boolean needsEscape(String name)
           
 LabelOperatorPrecedence precedence()
          Precedence of the top most operator.
 void save()
          Persists the state of this object into XML.
 
Methods inherited from class hudson.model.Label
and, compareTo, contains, equals, getApi, getBusyExecutors, getClouds, getDescription, getDisplayName, getIdleExecutors, getName, getNodes, getSearchUrl, getTiedJobs, getTotalConfiguredExecutors, getTotalExecutors, getUrl, hashCode, iff, implies, isAssignable, isEmpty, isOffline, isSelfLabel, matches, matches, not, or, paren, parse, parseExpression, toString
 
Methods inherited from class hudson.model.Actionable
addAction, getAction, getAction, getActions, getDynamic
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LabelAtom

public LabelAtom(String name)
Method Detail

getExpression

public String getExpression()
If the label contains 'unsafe' chars, escape them.

Specified by:
getExpression in class Label

getActions

public List<Action> getActions()
Gets actions contributed to this build.

A new Action can be added by getActions().add(...).

Note that this method returns a read-only view of Actions. LabelAtomPropertys who want to add a project action should do so by implementing LabelAtomProperty.getActions(LabelAtom).

Overrides:
getActions in class Actionable
Returns:
may be empty but never null.

getProperties

public DescribableList<LabelAtomProperty,LabelAtomPropertyDescriptor> getProperties()
Properties associated with this label.


getPropertiesList

@Exported
public List<LabelAtomProperty> getPropertiesList()

matches

public boolean matches(VariableResolver<Boolean> resolver)
Description copied from class: Label
Evaluates whether the label expression is true given the specified value assignment. IOW, returns true if the assignment provided by the resolver matches this label expression.

Specified by:
matches in class Label

precedence

public LabelOperatorPrecedence precedence()
Description copied from class: Label
Precedence of the top most operator.

Specified by:
precedence in class Label

save

public void save()
          throws IOException
Description copied from interface: Saveable
Persists the state of this object into XML.

For making a bulk change efficiently, see BulkChange.

To support listeners monitoring changes to this object, call SaveableListener.fireOnChange(Saveable, hudson.XmlFile)

Specified by:
save in interface Saveable
Throws:
IOException - if the persistence failed.

load

public void load()

getApplicablePropertyDescriptors

public List<LabelAtomPropertyDescriptor> getApplicablePropertyDescriptors()
Returns all the LabelAtomPropertyDescriptors that can be potentially configured on this label.


doConfigSubmit

public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req,
                           org.kohsuke.stapler.StaplerResponse rsp)
                    throws IOException,
                           javax.servlet.ServletException,
                           Descriptor.FormException
Accepts the update to the node configuration.

Throws:
IOException
javax.servlet.ServletException
Descriptor.FormException

get

public static LabelAtom get(String l)
Obtains an atom by its name.


needsEscape

public static boolean needsEscape(String name)

escape

public static String escape(String name)


Copyright © 2004-2013 Hudson. All Rights Reserved.