Package hudson.model.labels
Class LabelAtom
java.lang.Object
hudson.model.AbstractModelObject
hudson.model.Actionable
hudson.model.Label
hudson.model.labels.LabelAtom
- All Implemented Interfaces:
ModelObject
,Saveable
,SearchableModelObject
,SearchItem
,Comparable<Label>
,ModelObjectWithChildren
,ModelObjectWithContextMenu
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
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType
-
Field Summary
Fields inherited from class hudson.model.Label
loadStatistics, name, nodeProvisioner
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<V,
P> V accept
(LabelVisitor<V, P> visitor, P param) Accepts a visitor and call its respective "onXYZ" method based no the actual type of 'this'.void
doConfigSubmit
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Accepts the update to the node configuration.void
doSubmitDescription
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Accepts the new description.static String
static LabelAtom
findNearest
(String name) static LabelAtom
Obtains an atom by its name.Gets actions contributed to this object.Returns all theLabelAtomPropertyDescriptor
s that can be potentially configured on this label.Returns a human readable text that explains this label.If the label contains 'unsafe' chars, escape them.Properties associated with this label.boolean
isAtom()
Returns true iff this label is an atom.Lists all the atoms contained in this label.void
load()
boolean
matches
(VariableResolver<Boolean> resolver) Evaluates whether the label expression is true given the specified value assignment.static boolean
needsEscape
(String name) Precedence of the top most operator.void
save()
Persists the state of this object into XML.void
setDescription
(String description) protected void
Methods inherited from class hudson.model.Label
and, compareTo, contains, doChildrenContextMenu, equals, getApi, getBusyExecutors, getClouds, getDisplayName, getIdleExecutors, getName, getNodes, getSearchUrl, getSortedNodes, getTiedJobCount, 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, addOrReplaceAction, doContextMenu, doContextMenu, getAction, getAction, getActions, getAllActions, getDynamic, getDynamic, removeAction, removeActions, replaceAction, replaceActions
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendError
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface jenkins.model.ModelObjectWithChildren
doChildrenContextMenu
-
Field Details
-
transientActions
-
-
Constructor Details
-
LabelAtom
-
-
Method Details
-
getExpression
If the label contains 'unsafe' chars, escape them.- Specified by:
getExpression
in classLabel
-
isAtom
public boolean isAtom()Description copied from class:Label
Returns true iff this label is an atom. -
getActions
Gets actions contributed to this object.A new
Action
can be added byActionable.addAction(hudson.model.Action)
.If you are reading the list, rather than modifying it, use
Actionable.getAllActions()
instead. This method by default returns only persistent actions (though some subclasses override it to return an extended unmodifiable list).Note that this method returns a read-only view of
Action
s.LabelAtomProperty
s who want to add a project action should do so by implementingLabelAtomProperty.getActions(LabelAtom)
.- Overrides:
getActions
in classActionable
- Returns:
- a possibly empty list
-
updateTransientActions
protected void updateTransientActions() -
getDescription
Description copied from class:Label
Returns a human readable text that explains this label.- Overrides:
getDescription
in classLabel
- Since:
- 1.580
-
setDescription
- Throws:
IOException
-
getProperties
Properties associated with this label. -
getPropertiesList
-
matches
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. -
accept
Description copied from class:Label
Accepts a visitor and call its respective "onXYZ" method based no the actual type of 'this'. -
listAtoms
Description copied from class:Label
Lists all the atoms contained in this label. -
precedence
Description copied from class:Label
Precedence of the top most operator.- Specified by:
precedence
in classLabel
-
save
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(hudson.model.Saveable, hudson.XmlFile)
- Specified by:
save
in interfaceSaveable
- Throws:
IOException
- if the persistence failed.
-
load
public void load() -
getApplicablePropertyDescriptors
Returns all theLabelAtomPropertyDescriptor
s that can be potentially configured on this label. -
doConfigSubmit
@POST public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException, Descriptor.FormException Accepts the update to the node configuration.- Throws:
IOException
jakarta.servlet.ServletException
Descriptor.FormException
-
doSubmitDescription
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public void doSubmitDescription(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException Accepts the new description.- Throws:
IOException
jakarta.servlet.ServletException
-
get
Obtains an atom by its name.- See Also:
-
findNearest
-
needsEscape
-
escape
-