View Javadoc

1   /**
2    * Copyright 2005-2013 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       * @see org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean#getExpressionGraph()
47       */
48      public Map<String, String> getExpressionGraph() {
49          return expressionGraph;
50      }
51  
52      /**
53       * @see org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean#setExpressionGraph(java.util.Map<java.lang.String,java.lang.String>)
54       */
55      public void setExpressionGraph(Map<String, String> expressionGraph) {
56          this.expressionGraph = expressionGraph;
57      }
58  
59      /**
60       * @see org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean#getRefreshExpressionGraph()
61       */
62      public Map<String, String> getRefreshExpressionGraph() {
63          return refreshExpressionGraph;
64      }
65  
66      /**
67       * @see org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean#setRefreshExpressionGraph(java.util.Map<java.lang.String,java.lang.String>)
68       */
69      public void setRefreshExpressionGraph(Map<String, String> refreshExpressionGraph) {
70          this.refreshExpressionGraph = refreshExpressionGraph;
71      }
72  
73      /**
74       * @see org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean#getPropertyExpressions
75       */
76      public Map<String, String> getPropertyExpressions() {
77          return propertyExpressions;
78      }
79  
80      /**
81       * @see org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean#setPropertyExpressions
82       */
83      public void setPropertyExpressions(Map<String, String> propertyExpressions) {
84          this.propertyExpressions = propertyExpressions;
85      }
86  
87      /**
88       * @see org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean#getPropertyExpression
89       */
90      public String getPropertyExpression(String propertyName) {
91          if (this.propertyExpressions.containsKey(propertyName)) {
92              return this.propertyExpressions.get(propertyName);
93          }
94  
95          return null;
96      }
97  }