hudson.scm
Class ChangeLogAnnotator

java.lang.Object
  extended by hudson.scm.ChangeLogAnnotator
All Implemented Interfaces:
ExtensionPoint

public abstract class ChangeLogAnnotator
extends Object
implements ExtensionPoint

Performs mark up on changelog messages to be displayed.

SCM changelog messages are usually plain text, but when we display that in Hudson, it is often nice to be able to put mark up on the text (for example to link to external issue tracking system.)

Plugins that are interested in doing so may extend this class and put Extension on it. When multiple annotators are registered, their results will be combined.

Since:
1.70
Author:
Kohsuke Kawaguchi

Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
static CopyOnWriteList<ChangeLogAnnotator> annotators
          Deprecated. as of 1.286 Use all() for read access, and Extension for registration.
 
Constructor Summary
ChangeLogAnnotator()
           
 
Method Summary
static ExtensionList<ChangeLogAnnotator> all()
          Returns all the registered ChangeLogAnnotator descriptors.
abstract  void annotate(AbstractBuild<?,?> build, ChangeLogSet.Entry change, MarkupText text)
          Called by Hudson to allow markups to be added to the changelog text.
 void register()
          Deprecated. as of 1.286 Prefer automatic registration via Extension
 boolean unregister()
          Unregisters this annotator, so that Hudson stops using this object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

annotators

public static final CopyOnWriteList<ChangeLogAnnotator> annotators
Deprecated. as of 1.286 Use all() for read access, and Extension for registration.
All registered ChangeLogAnnotators.

Constructor Detail

ChangeLogAnnotator

public ChangeLogAnnotator()
Method Detail

annotate

public abstract void annotate(AbstractBuild<?,?> build,
                              ChangeLogSet.Entry change,
                              MarkupText text)
Called by Hudson to allow markups to be added to the changelog text.

This method is invoked each time a page is rendered, so implementations of this method should not take too long to execute. Also note that this method may be invoked concurrently by multiple threads.

If there's any error during the processing, it should be recorded in Logger and the method should return normally.

Parameters:
build - Build that owns this changelog. From here you can access broader contextual information, like the project, or it settings. Never null.
change - The changelog entry for which this method is adding markup. Never null.
text - The text and markups. Implementation of this method is expected to add additional annotations into this object. If other annotators are registered, the object may already contain some markups when this method is invoked. Never null. MarkupText.getText() on this instance will return the same string as ChangeLogSet.Entry.getMsgEscaped().

register

public final void register()
Deprecated. as of 1.286 Prefer automatic registration via Extension

Registers this annotator, so that Hudson starts using this object for adding markup.


unregister

public final boolean unregister()
Unregisters this annotator, so that Hudson stops using this object.


all

public static ExtensionList<ChangeLogAnnotator> all()
Returns all the registered ChangeLogAnnotator descriptors.



Copyright © 2004-2013 Hudson. All Rights Reserved.