KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hudson > scm > SCMS


1 package hudson.scm;
2
3 import hudson.model.Descriptor;
4 import hudson.model.Descriptor.FormException;
5
6 import java.util.List JavaDoc;
7
8 import org.kohsuke.stapler.StaplerRequest;
9
10 /**
11  * @author Kohsuke Kawaguchi
12  */

13 public class SCMS {
14     /**
15      * List of all installed SCMs.
16      */

17     @SuppressWarnings JavaDoc("unchecked") // generic array creation
18
public static final List JavaDoc<Descriptor<SCM>> SCMS =
19         Descriptor.toList(
20             NullSCM.DESCRIPTOR,
21             CVSSCM.DescriptorImpl.DESCRIPTOR,
22             SubversionSCM.DescriptorImpl.DESCRIPTOR);
23
24     /**
25      * Parses {@link SCM} configuration from the submitted form.
26      */

27     public static SCM parseSCM(StaplerRequest req) throws FormException {
28         int scmidx = Integer.parseInt(req.getParameter("scm"));
29         return SCMS.get(scmidx).newInstance(req);
30     }
31 }
32
Popular Tags