1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.datadictionary.uif;
17
18 import com.google.common.collect.Maps;
19 import org.kuali.rice.krad.datadictionary.DictionaryBeanBase;
20
21 import java.util.HashMap;
22 import java.util.Map;
23
24
25
26
27
28
29
30
31
32
33
34 public class UifDictionaryBeanBase extends DictionaryBeanBase implements UifDictionaryBean {
35
36 private Map<String, String> expressionGraph;
37 private Map<String, String> refreshExpressionGraph;
38 private Map<String, String> propertyExpressions;
39
40 public UifDictionaryBeanBase() {
41 expressionGraph = new HashMap<String, String>();
42 refreshExpressionGraph = new HashMap<String, String>();
43 propertyExpressions = new HashMap<String, String>();
44 }
45
46
47
48
49 public Map<String, String> getExpressionGraph() {
50 return expressionGraph;
51 }
52
53
54
55
56 public void setExpressionGraph(Map<String, String> expressionGraph) {
57 this.expressionGraph = expressionGraph;
58 }
59
60
61
62
63 public Map<String, String> getRefreshExpressionGraph() {
64 return refreshExpressionGraph;
65 }
66
67
68
69
70 public void setRefreshExpressionGraph(Map<String, String> refreshExpressionGraph) {
71 this.refreshExpressionGraph = refreshExpressionGraph;
72 }
73
74
75
76
77 public Map<String, String> getPropertyExpressions() {
78 return propertyExpressions;
79 }
80
81
82
83
84 public void setPropertyExpressions(Map<String, String> propertyExpressions) {
85 this.propertyExpressions = propertyExpressions;
86 }
87
88
89
90
91 public String getPropertyExpression(String propertyName) {
92 if (this.propertyExpressions.containsKey(propertyName)) {
93 return this.propertyExpressions.get(propertyName);
94 }
95
96 return null;
97 }
98
99 @Override
100 protected <T> void copyProperties(T dictionaryBaseBean) {
101 super.copyProperties(dictionaryBaseBean);
102 UifDictionaryBeanBase uifDictionaryBeanBaseCopy = (UifDictionaryBeanBase) dictionaryBaseBean;
103
104 if (expressionGraph != null) {
105 Map<String, String> expressionGraphCopy = Maps.newHashMapWithExpectedSize(this.getExpressionGraph().size());
106 for (Map.Entry expressionGraphEntry : getExpressionGraph().entrySet()) {
107 expressionGraphCopy.put(expressionGraphEntry.getKey().toString(),
108 expressionGraphEntry.getValue().toString());
109 }
110
111 uifDictionaryBeanBaseCopy.setExpressionGraph(expressionGraphCopy);
112 }
113
114 if (refreshExpressionGraph != null) {
115 Map<String, String> refreshExpressionGraphCopy = Maps.newHashMapWithExpectedSize(
116 this.getRefreshExpressionGraph().size());
117 for (Map.Entry refreshExpressionGraphEntry : getRefreshExpressionGraph().entrySet()) {
118 refreshExpressionGraphCopy.put(refreshExpressionGraphEntry.getKey().toString(),
119 refreshExpressionGraphEntry.getValue().toString());
120 }
121
122 uifDictionaryBeanBaseCopy.setRefreshExpressionGraph(refreshExpressionGraphCopy);
123 }
124
125 if (propertyExpressions != null) {
126 Map<String, String> propertyExpressionsCopy = Maps.newHashMapWithExpectedSize(
127 this.getPropertyExpressions().size());
128 for (Map.Entry propertyExpressionsEntry : getPropertyExpressions().entrySet()) {
129 propertyExpressionsCopy.put(propertyExpressionsEntry.getKey().toString(),
130 propertyExpressionsEntry.getValue().toString());
131 }
132
133 uifDictionaryBeanBaseCopy.setPropertyExpressions(propertyExpressionsCopy);
134 }
135 }
136 }