1 /**
2 * Copyright 2005-2015 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;
17
18 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
19 import org.kuali.rice.krad.uif.util.CopyUtils;
20
21 /**
22 * Common base for all objects that can be configured in the dictionary
23 *
24 * @author Kuali Rice Team (rice.collab@kuali.org)
25 */
26 public abstract class DictionaryBeanBase implements DictionaryBean, Copyable {
27 private static final long serialVersionUID = 4334492273538657771L;
28
29 protected String namespaceCode;
30 protected String componentCode;
31
32 public DictionaryBeanBase() {}
33
34 /**
35 * @see DictionaryBean#getNamespaceCode()
36 */
37 @Override
38 @BeanTagAttribute(name = "namespaceCode")
39 public String getNamespaceCode() {
40 return namespaceCode;
41 }
42
43 /**
44 * Setter for the bean's associated namespace code
45 *
46 * @param namespaceCode
47 */
48 public void setNamespaceCode(String namespaceCode) {
49 this.namespaceCode = namespaceCode;
50 }
51
52 /**
53 * @see DictionaryBean#getComponentCode()
54 */
55 @Override
56 @BeanTagAttribute(name = "componentCode")
57 public String getComponentCode() {
58 return componentCode;
59 }
60
61 /**
62 * Setter for the bean's associated component code
63 *
64 * @param componentCode
65 */
66 public void setComponentCode(String componentCode) {
67 this.componentCode = componentCode;
68 }
69
70 /**
71 * @see Copyable#clone()
72 */
73 @Override
74 public DictionaryBeanBase clone() throws CloneNotSupportedException {
75 return (DictionaryBeanBase) super.clone();
76 }
77
78 /**
79 * @see Copyable#copy()
80 * @see CopyUtils#copy(Copyable)
81 */
82 public <T> T copy() {
83 return CopyUtils.copy(this);
84 }
85
86 @Override
87 public void dataDictionaryPostProcessing() {
88 // Do nothing here - will be implemented by subclasses
89 }
90 }