1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.contract.writer.service;
17
18 import java.util.List;
19
20 import org.kuali.student.contract.model.ServiceContractModel;
21 import org.kuali.student.contract.model.ServiceMethod;
22 import org.kuali.student.contract.model.util.ModelFinder;
23
24
25
26
27
28 public class EachMethodServiceWriterForOneService {
29
30 private ServiceContractModel model;
31 private ModelFinder finder;
32 private String directory;
33 private String rootPackage;
34 private String servKey;
35
36 public EachMethodServiceWriterForOneService(ServiceContractModel model,
37 String directory,
38 String rootPackage,
39 String servKey) {
40 this.model = model;
41 this.finder = new ModelFinder(model);
42 this.directory = directory;
43 this.rootPackage = rootPackage;
44 this.servKey = servKey;
45 }
46
47
48
49
50
51 public void write() {
52 List<ServiceMethod> methods = finder.getServiceMethodsInService(servKey);
53 if (methods.isEmpty()) {
54 System.out.println("No methods defined for servKey: " + servKey);
55 return;
56 }
57
58
59 System.out.println("Generating info interfaces");
60 for (ServiceMethod method : methods) {
61 System.out.println("Generating method for service " + method.getService() + "." + method.getName());
62 new EachMethodServiceWriterForOneMethod(model, directory, rootPackage, servKey, method).write();
63 }
64
65 }
66
67 }