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 theCauseActionobject.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 classCause.LegacyCodeCauseDeprecated.since 2009-02-08static classCause.RemoteCausestatic classCause.UpstreamCauseA build is triggered by another build (AKA upstream build.)static classCause.UserCauseDeprecated.1.428 useCause.UserIdCausestatic classCause.UserIdCauseA 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 StringgetShortDescription()One-line human-readable text of the cause.voidonAddedTo(AbstractBuild build)Deprecated.voidonAddedTo(Run build)Called when the cause is registered.voidonLoad(AbstractBuild<?,?> build)Deprecated.voidonLoad(Run<?,?> build)Called when a build is loaded from disk.voidprint(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.jellyview 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
-
-