
hudson.model.PageDecorator Maven / Gradle / Ivy
package hudson.model;
import hudson.ExtensionPoint;
import hudson.Plugin;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
/**
* Participates in the rendering of HTML pages for all pages of Hudson.
*
*
* This class provides a few hooks to augument the HTML generation process of Hudson, across
* all the HTML pages that Hudson delivers.
*
*
* For example, if you'd like to add a Google Analytics stat to Hudson, then you need to inject
* a small script fragment to all Hudson pages. This extension point provides a means to do that.
*
*
Life-cycle
*
* Instances of this class is singleton. {@link Plugin}s that contribute this extension point
* should instantiate a new decorator and add it to the {@link #ALL} list in {@link Plugin#start()}.
*
*
Associated Views
* global.jelly
*
* If this extension point needs to expose a global configuration, write this jelly page.
* See {@link Descriptor} for more about this. Optional.
*
*
footer.jelly
*
* This page is added right before the </body> tag. Convenient place for adding tracking beacons, etc.
*
*
header.jelly
*
* This page is added right before the </head> tag. Convenient place for additional stylesheet,
* <meta> tags, etc.
*
*
* @author Kohsuke Kawaguchi
* @since 1.235
*/
public abstract class PageDecorator extends Descriptor implements ExtensionPoint, Describable {
/**
* @param yourClass
* pass-in "this.getClass()" (except that the constructor parameters cannot use 'this',
* so you'd have to hard-code the class name.
*/
protected PageDecorator(Class extends PageDecorator> yourClass) {
super(yourClass);
}
public final Descriptor getDescriptor() {
return this;
}
/**
* Unless this object has additional web presence, display name is not used at all.
* So default to "".
*/
public String getDisplayName() {
return "";
}
/**
* All the registered instances.
*/
public static final List ALL = new CopyOnWriteArrayList();
}