File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\core\src\main\java\jenkins\model\GlobalConfiguration.java.html

1 package jenkins.model;
2
3 import hudson.ExtensionList;
4 import hudson.ExtensionPoint;
5 import hudson.model.Describable;
6 import hudson.model.Descriptor;
7
8 /**
9 * Convenient base class for extensions that contributes to the system configuration page but nothing else.
10 *
11 * <p>
12 * All {@link Descriptor}s are capable of contributing fragment to the system config page, so
13 * this extension point is is really only for those who don't want to contribute anything else.
14 * If you are implementing other extension points and that would like to expose some global configuration,
15 * you can do so with <tt>global.groovy</tt> from your {@link Descriptor} instance.
16 *
17 * <h2>Views</h2>
18 * <p>
19 * Subtypes of this class should define <tt>config.groovy</tt> that gets pulled into the system configuration page.
20 *
21 *
22 * @author Kohsuke Kawaguchi
23 * @since 1.425
24 */
25 public abstract class GlobalConfiguration extends Descriptor<GlobalConfiguration> implements ExtensionPoint, Describable<GlobalConfiguration> {
26 protected GlobalConfiguration() {
27 super(self());
28 }
29
30 public final Descriptor<GlobalConfiguration> getDescriptor() {
31 return this;
32 }
33
34 /**
35 * Every {@link GlobalConfiguration} belongs to a specific category.
36 *
37 * @return never null, always the same value for a given instance of {@link GlobalConfiguration}.
38 */
39 public GlobalConfigurationCategory getCategory() {
40 return GlobalConfigurationCategory.get(GlobalConfigurationCategory.Unclassified.class);
41 }
42
43 /**
44 * Unless this object has additional web presence, display name is not used at all.
45 * So default to "".
46 */
47 public String getDisplayName() {
48 return "";
49 }
50
51 @Override
52 public String getGlobalConfigPage() {
53 return getConfigPage();
54 }
55
56 /**
57 * Returns all the registered {@link GlobalConfiguration} descriptors.
58 */
59 public static ExtensionList<GlobalConfiguration> all() {
60 return Jenkins.getInstance().<GlobalConfiguration,GlobalConfiguration>getDescriptorList(GlobalConfiguration.class);
61 // pointless type parameters help work around bugs in javac in earlier versions http://codepad.org/m1bbFRrH
62 }
63 }
64