1 | |
package org.kuali.student.common.ui.client.util; |
2 | |
|
3 | |
import java.io.Serializable; |
4 | |
import java.util.List; |
5 | |
|
6 | |
public class ExportElement implements Serializable { |
7 | |
|
8 | |
private static final long serialVersionUID = 1L; |
9 | |
private String fieldLabel; |
10 | |
private boolean isMandatory; |
11 | |
|
12 | |
private String fieldValue; |
13 | |
private String fieldValue2; |
14 | |
private String viewName; |
15 | |
|
16 | |
public ExportElement() { |
17 | 12 | super(); |
18 | 12 | } |
19 | |
|
20 | |
public ExportElement(String viewName, String sectionName) { |
21 | 0 | super(); |
22 | 0 | this.viewName = viewName; |
23 | 0 | this.sectionName = sectionName; |
24 | 0 | } |
25 | |
|
26 | |
private String sectionName; |
27 | |
private List<ExportElement> subset; |
28 | |
|
29 | |
public String getViewName() { |
30 | 0 | return viewName; |
31 | |
} |
32 | |
|
33 | |
public void setViewName(String viewName) { |
34 | 0 | this.viewName = viewName; |
35 | 0 | } |
36 | |
|
37 | |
public String getSectionName() { |
38 | 44 | return sectionName; |
39 | |
} |
40 | |
|
41 | |
public void setSectionName(String sectionName) { |
42 | 9 | this.sectionName = sectionName; |
43 | 9 | } |
44 | |
|
45 | |
public String getFieldLabel() { |
46 | 84 | return fieldLabel; |
47 | |
} |
48 | |
|
49 | |
public void setFieldLabel(String fieldLabel) { |
50 | 11 | this.fieldLabel = fieldLabel; |
51 | 11 | } |
52 | |
|
53 | |
public String getFieldValue() { |
54 | 84 | return this.fieldValue; |
55 | |
} |
56 | |
|
57 | |
public void setFieldValue(String fieldValue) { |
58 | 9 | this.fieldValue = fieldValue; |
59 | 9 | } |
60 | |
|
61 | |
public boolean isSub() { |
62 | 44 | return subset != null; |
63 | |
} |
64 | |
|
65 | |
public List<ExportElement> getSubset() { |
66 | 44 | return subset; |
67 | |
} |
68 | |
|
69 | |
public void setSubset(List<ExportElement> subset) { |
70 | 2 | if (subset != null && subset.size() > 0) { |
71 | 2 | this.subset = subset; |
72 | |
} |
73 | 2 | } |
74 | |
|
75 | |
public boolean isMandatory() { |
76 | 44 | return isMandatory; |
77 | |
} |
78 | |
|
79 | |
public void setMandatory(boolean isMandatory) { |
80 | 2 | this.isMandatory = isMandatory; |
81 | 2 | } |
82 | |
|
83 | |
public String getFieldValue2() { |
84 | 19 | return fieldValue2; |
85 | |
} |
86 | |
|
87 | |
public void setFieldValue2(String fieldValue2) { |
88 | 7 | this.fieldValue2 = fieldValue2; |
89 | 7 | } |
90 | |
|
91 | |
public String getKey() { |
92 | 44 | if (this.getFieldLabel() != null) { |
93 | 40 | return this.getFieldLabel(); |
94 | |
} |
95 | 4 | return ""; |
96 | |
} |
97 | |
|
98 | |
public String getValue() { |
99 | 36 | if (this.getFieldValue() != null) { |
100 | 27 | return getFieldValue(); |
101 | |
} |
102 | 9 | return ""; |
103 | |
} |
104 | |
|
105 | |
public String getProposalValue() { |
106 | 12 | if (this.getFieldValue() != null) { |
107 | 9 | return getFieldValue(); |
108 | |
} |
109 | 3 | return ""; |
110 | |
} |
111 | |
|
112 | |
public String getOriginalValue() { |
113 | 12 | if (this.getFieldValue2() != null) { |
114 | 7 | return this.getFieldValue2(); |
115 | |
} |
116 | 5 | return ""; |
117 | |
} |
118 | |
|
119 | |
public boolean isEmpty() { |
120 | 48 | if ((this.fieldLabel == null) && (this.fieldValue == null) && (this.fieldValue2 == null) && (this.subset == null)) { |
121 | 4 | return true; |
122 | |
} |
123 | 44 | return false; |
124 | |
} |
125 | |
|
126 | |
public String printLine() { |
127 | 0 | String output = new String(); |
128 | 0 | output = this.sectionName + " - " + this.viewName + " - " + this.getFieldLabel() + " - " + this.getFieldValue() + " - " + this.getFieldValue2(); |
129 | 0 | return output; |
130 | |
} |
131 | |
|
132 | |
} |