1 /**
2 * Copyright 2005-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.rice.krad.datadictionary.uif;
17
18 import org.kuali.rice.krad.datadictionary.DictionaryBeanBase;
19
20 import java.util.HashMap;
21 import java.util.Map;
22
23 /**
24 * Common base class for dictionary objects that can contain dynamic expressions within the
25 * property value
26 *
27 * <p>
28 * Should be extended by other classes to provide property expression support
29 * </p>
30 *
31 * @author Kuali Rice Team (rice.collab@kuali.org)
32 */
33 public class UifDictionaryBeanBase extends DictionaryBeanBase implements UifDictionaryBean {
34
35 private Map<String, String> expressionGraph;
36 private Map<String, String> refreshExpressionGraph;
37 private Map<String, String> propertyExpressions;
38
39 public UifDictionaryBeanBase() {
40 expressionGraph = new HashMap<String, String>();
41 refreshExpressionGraph = new HashMap<String, String>();
42 propertyExpressions = new HashMap<String, String>();
43 }
44
45 /**
46 * {@inheritDoc}
47 */
48 @Override
49 public Map<String, String> getExpressionGraph() {
50 return expressionGraph;
51 }
52
53 /**
54 * {@inheritDoc}
55 */
56 @Override
57 public void setExpressionGraph(Map<String, String> expressionGraph) {
58 this.expressionGraph = expressionGraph;
59 }
60
61 /**
62 * @see org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean#getPropertyExpressions
63 */
64 public Map<String, String> getPropertyExpressions() {
65 return propertyExpressions;
66 }
67
68 /**
69 * @see org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean#setPropertyExpressions
70 */
71 public void setPropertyExpressions(Map<String, String> propertyExpressions) {
72 this.propertyExpressions = propertyExpressions;
73 }
74
75 /**
76 * @see org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean#getPropertyExpression
77 */
78 public String getPropertyExpression(String propertyName) {
79 if (this.propertyExpressions.containsKey(propertyName)) {
80 return this.propertyExpressions.get(propertyName);
81 }
82
83 return null;
84 }
85 }