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 the CauseAction object.

Views

description.jelly
Renders the cause to HTML. By default, it puts the short description.
Author:
Michael Donohue
See Also:
  • Constructor Details

    • Cause

      public Cause()
  • Method Details

    • 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 custom description.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 be transient.
      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