Package hudson.model
Class Cause
- java.lang.Object
-
- hudson.model.Cause
-
- Direct Known Subclasses:
Cause.LegacyCodeCause
,Cause.RemoteCause
,Cause.UpstreamCause
,Cause.UpstreamCause.DeeplyNestedUpstreamCause
,Cause.UserCause
,Cause.UserIdCause
,SCMTrigger.SCMTriggerCause
,TimerTrigger.TimerTriggerCause
@ExportedBean public abstract class Cause extends Object
Cause object base class. This class hierarchy is used to keep track of why a given build was started. This object encapsulates the UI rendering of the cause, as well as providing more useful information in respective subtypes. The Cause object is connected to a build via theCauseAction
object.Views
- description.jelly
- Renders the cause to HTML. By default, it puts the short description.
- Author:
- Michael Donohue
- See Also:
Run.getCauses()
,Queue.Item.getCauses()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Cause.LegacyCodeCause
Deprecated.since 2009-02-08static class
Cause.RemoteCause
static class
Cause.UpstreamCause
A build is triggered by another build (AKA upstream build.)static class
Cause.UserCause
Deprecated.1.428 useCause.UserIdCause
static class
Cause.UserIdCause
A build is started by an user action.
-
Constructor Summary
Constructors Constructor Description Cause()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract String
getShortDescription()
One-line human-readable text of the cause.void
onAddedTo(AbstractBuild build)
Deprecated.void
onAddedTo(Run build)
Called when the cause is registered.void
onLoad(AbstractBuild<?,?> build)
Deprecated.void
onLoad(Run<?,?> build)
Called when a build is loaded from disk.void
print(TaskListener listener)
Report a line to the listener about this cause.
-
-
-
Method Detail
-
getShortDescription
@Exported(visibility=3) public abstract String getShortDescription()
One-line human-readable text of the cause. Historically, this method's return value was used to render HTML on the UI as well. Since Jenkins 2.315 and 2.303.2, the return value is interpreted as text. To have rich HTML output on the UI, provide a customdescription.jelly
view for your subclass. See the documentation.
-
onAddedTo
public void onAddedTo(@NonNull Run build)
Called when the cause is registered.- Since:
- 1.568
-
onAddedTo
@Deprecated public void onAddedTo(AbstractBuild build)
Deprecated.
-
onLoad
public void onLoad(@NonNull Run<?,?> build)
Called when a build is loaded from disk. Useful in case the cause needs to keep a build reference; this ought to betransient
.- Since:
- 1.568
-
onLoad
@Deprecated public void onLoad(AbstractBuild<?,?> build)
Deprecated.
-
print
public void print(TaskListener listener)
Report a line to the listener about this cause.- Since:
- 1.362
-
-