1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kns_2_4_M2.datadictionary;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 import org.apache.commons.lang.StringUtils;
22 import org.kuali.rice.krad.datadictionary.DataDictionaryDefinitionBase;
23 import org.kuali.rice.krad.inquiry.Inquirable;
24
25
26
27
28
29
30
31
32
33
34 @Deprecated
35 public class InquiryDefinition extends DataDictionaryDefinitionBase {
36 private static final long serialVersionUID = -2506403061297774668L;
37
38 protected String title;
39 protected List<InquirySectionDefinition> inquirySections = new ArrayList<InquirySectionDefinition>();
40 protected Class<? extends Inquirable> inquirableClass;
41
42 protected boolean translateCodes = true;
43
44 public InquiryDefinition() {
45 }
46
47
48 public String getTitle() {
49 return title;
50 }
51
52
53
54
55
56
57 public void setTitle(String title) {
58 if (StringUtils.isBlank(title)) {
59 throw new IllegalArgumentException("invalid (blank) title");
60 }
61
62 this.title = title;
63 }
64
65
66
67
68
69 public List<InquirySectionDefinition> getInquirySections() {
70 return inquirySections;
71 }
72
73
74
75
76
77
78 public FieldDefinition getFieldDefinition(String fieldName) {
79 for (InquirySectionDefinition section : inquirySections ) {
80 for (FieldDefinition field : section.getInquiryFields() ) {
81 if (field.getAttributeName().equals(fieldName)) {
82 return field;
83 }
84 }
85 }
86
87 return null;
88 }
89
90
91
92
93
94
95 public void completeValidation(Class rootBusinessObjectClass, Class otherBusinessObjectClass) {
96 for ( InquirySectionDefinition inquirySection : inquirySections ) {
97 inquirySection.completeValidation(rootBusinessObjectClass, null);
98 }
99 }
100
101 public InquirySectionDefinition getInquirySection( String sectionTitle ) {
102 for ( InquirySectionDefinition inquirySection : inquirySections ) {
103 if ( inquirySection.getTitle().equals(sectionTitle) ) {
104 return inquirySection;
105 }
106 }
107 return null;
108 }
109
110
111
112
113
114 public String toString() {
115 return "InquiryDefinition '" + getTitle() + "'";
116 }
117
118
119 public Class<? extends Inquirable> getInquirableClass() {
120 return inquirableClass;
121 }
122
123
124
125
126
127
128
129
130
131
132
133 public void setInquirableClass(Class<? extends Inquirable> inquirableClass) {
134 this.inquirableClass = inquirableClass;
135 }
136
137
138
139
140
141 public void setInquirySections(List<InquirySectionDefinition> inquirySections) {
142 this.inquirySections = inquirySections;
143 }
144
145
146 public boolean isTranslateCodes() {
147 return this.translateCodes;
148 }
149
150
151 public void setTranslateCodes(boolean translateCodes) {
152 this.translateCodes = translateCodes;
153 }
154
155 }