View Javadoc

1   /*
2    * Copyright 2009 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.osedu.org/licenses/ECL-2.0
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.ArrayList;
19  import java.util.List;
20  
21  /**
22   *
23   * @author nwright
24   */
25  public class OrchestrationObjectField {
26  
27      private OrchestrationObject parent;
28      private String name;
29      private String type;
30  
31      public enum FieldTypeCategory {
32  
33          PRIMITIVE,
34          MAPPED_STRING,
35          DYNAMIC_ATTRIBUTE,
36          COMPLEX,
37          COMPLEX_INLINE,
38          LIST_OF_PRIMITIVE,
39          LIST_OF_MAPPED_STRING,
40          LIST_OF_COMPLEX,
41          LIST_OF_COMPLEX_INLINE;
42      }
43  
44      public OrchestrationObject getParent() {
45          return parent;
46      }
47  
48      public void setParent(OrchestrationObject parent) {
49          this.parent = parent;
50      }
51  
52      public void setName(String name) {
53          this.name = name;
54      }
55  
56      public String getName() {
57          return name;
58      }
59  
60      public String getPropertyName() {
61          return name.substring(0, 1).toLowerCase() + name.substring(1);
62      }
63  
64      public String getProperName() {
65          return name.substring(0, 1).toUpperCase() + name.substring(1);
66      }
67  
68      public void setType(String type) {
69          this.type = type;
70      }
71  
72      public String getType() {
73          return type;
74      }
75      private FieldTypeCategory fieldTypeCategory;
76  
77      public FieldTypeCategory getFieldTypeCategory() {
78          return fieldTypeCategory;
79      }
80  
81      public void setFieldTypeCategory(
82              FieldTypeCategory fieldTypeCategory) {
83          this.fieldTypeCategory = fieldTypeCategory;
84      }
85      private OrchestrationObject inlineObject;
86  
87      public OrchestrationObject getInlineObject() {
88          return inlineObject;
89      }
90  
91      public void setInlineObject(OrchestrationObject inlineObject) {
92          this.inlineObject = inlineObject;
93      }
94      private List<TypeStateConstraint> constraints;
95  
96      public List<TypeStateConstraint> getConstraints() {
97          if (constraints == null) {
98              constraints = new ArrayList();
99          }
100         return constraints;
101     }
102 
103     public void setConstraints(List<TypeStateConstraint> constraints) {
104         this.constraints = constraints;
105     }
106     private String defaultValue;
107 
108     public String getDefaultValue() {
109         return defaultValue;
110     }
111 
112     public void setDefaultValue(String defaultValue) {
113         this.defaultValue = defaultValue;
114     }
115     private String defaultValuePath;
116 
117     public String getDefaultValuePath() {
118         return defaultValuePath;
119     }
120 
121     public void setDefaultValuePath(String defaultValuePath) {
122         this.defaultValuePath = defaultValuePath;
123     }
124 
125     public String getFullyQualifiedName() {
126         //TODO: Get grand parent
127         StringBuffer buf = new StringBuffer();
128         buf.append(getParent().getName());
129         buf.append(".");
130         buf.append(getProperName());
131         return buf.toString();
132     }
133 
134     public enum WriteAccess {
135 
136         ALWAYS, NEVER, ON_CREATE;
137     }
138     private WriteAccess writeAccess;
139 
140     public WriteAccess getWriteAccess() {
141         return writeAccess;
142     }
143 
144     public void setWriteAccess(WriteAccess writeAccess) {
145         this.writeAccess = writeAccess;
146     }
147     private String lookup;
148 
149     public String getLookup() {
150         return lookup;
151     }
152 
153     public void setLookup(String lookup) {
154         this.lookup = lookup;
155     }
156     private List<String> additionalLookups;
157 
158     public List<String> getAdditionalLookups() {
159         return additionalLookups;
160     }
161 
162     public void setAdditionalLookups(List<String> additionalLookups) {
163         this.additionalLookups = additionalLookups;
164     }
165     private String lookupContextPath;
166 
167     public String getLookupContextPath() {
168         return lookupContextPath;
169     }
170 
171     public void setLookupContextPath(String lookupContextPath) {
172         this.lookupContextPath = lookupContextPath;
173     }
174     private Integer maxRecursions;
175 
176     public Integer getMaxRecursions() {
177         return maxRecursions;
178     }
179 
180     public void setMaxRecursions(Integer maxRecursions) {
181         this.maxRecursions = maxRecursions;
182     }
183 }