View Javadoc
1   /**
2    * Copyright 2004-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.student.contract.model;
17  
18  import java.util.List;
19  
20  /**
21   *
22   * @author nwright
23   */
24  public class OrchestrationObject {
25  
26      public enum Source {
27  
28          MESSAGE_STRUCTURE, ORCH_OBJS;
29      }
30      private List<OrchestrationObjectField> fields;
31      private String name;
32  
33      public void setName(String name) {
34          this.name = name;
35      }
36  
37      public String getName() {
38          return name;
39      }
40  
41      public void setFields(List<OrchestrationObjectField> fields) {
42          this.fields = fields;
43      }
44  
45      public List<OrchestrationObjectField> getFields() {
46          return fields;
47      }
48      private boolean hasOwnCreateUpdate;
49  
50      public boolean hasOwnCreateUpdate() {
51          return hasOwnCreateUpdate;
52      }
53  
54      public void setHasOwnCreateUpdate(boolean hasOwnCreateUpdate) {
55          this.hasOwnCreateUpdate = hasOwnCreateUpdate;
56      }
57      private OrchestrationObjectField inlineField;
58  
59      public OrchestrationObjectField getInlineField() {
60          return inlineField;
61      }
62  
63      public void setInlineField(OrchestrationObjectField inlineField) {
64          this.inlineField = inlineField;
65      }
66      private String orchestrationPackagePath;
67  
68      public String getOrchestrationPackagePath() {
69          return orchestrationPackagePath;
70      }
71  
72      public void setOrchestrationPackagePath(String packagePath) {
73          this.orchestrationPackagePath = packagePath;
74      }
75      private String infoPackagePath;
76  
77      public String getInfoPackagePath() {
78          return infoPackagePath;
79      }
80  
81      public void setInfoPackagePath(String infoPackagePath) {
82          this.infoPackagePath = infoPackagePath;
83      }
84  
85      public String getJavaClassInfoName() {
86          return name.substring(0, 1).toUpperCase() + name.substring(1);
87      }
88  
89      public String getFullyQualifiedJavaClassInfoName() {
90          return this.infoPackagePath + "." + this.getJavaClassInfoName();
91      }
92  
93      public String getJavaClassHelperName() {
94          if (inlineField == null) {
95              return getJavaClassInfoName() + "Helper";
96          }
97          return inlineField.getParent().getJavaClassInfoName()
98                  + getJavaClassInfoName() + "Helper";
99      }
100 
101     public String getFullyQualifiedJavaClassHelperName() {
102         return orchestrationPackagePath + "." + getJavaClassHelperName();
103     }
104 
105     public String getJavaClassConstantsName() {
106         if (inlineField == null) {
107             return getJavaClassInfoName() + "Constants";
108         }
109         return inlineField.getParent().getJavaClassInfoName()
110                 + getJavaClassInfoName() + "Constants";
111     }
112 
113     public String getFullyQualifiedJavaClassConstantsName() {
114         return orchestrationPackagePath + "." + getJavaClassConstantsName();
115     }
116 
117     public String getJavaClassMetadataName() {
118         if (inlineField == null) {
119             return getJavaClassInfoName() + "Metadata";
120         }
121         return inlineField.getParent().getJavaClassInfoName()
122                 + getJavaClassInfoName() + "Metadata";
123     }
124 
125     public String getFullyQualifiedJavaClassMetadataName() {
126         return orchestrationPackagePath + "." + getJavaClassMetadataName();
127     }
128 
129     public String getJavaClassAssemblerName() {
130         if (inlineField == null) {
131             return getJavaClassInfoName() + "Assembler";
132         }
133         return inlineField.getParent().getJavaClassInfoName()
134                 + getJavaClassInfoName() + "Assembler";
135     }
136 
137     public String getFullyQualifiedJavaClassAssemblerName() {
138         return orchestrationPackagePath + ".assembler." + getJavaClassAssemblerName();
139     }
140     private Source source;
141 
142     public Source getSource() {
143         return source;
144     }
145 
146     public void setSource(Source source) {
147         this.source = source;
148     }
149 }