001/**
002 * Copyright 2005-2018 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.krad.datadictionary;
017
018import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
019import org.kuali.rice.krad.uif.util.CopyUtils;
020
021/**
022 * Common base for all objects that can be configured in the dictionary
023 *
024 * @author Kuali Rice Team (rice.collab@kuali.org)
025 */
026public abstract class DictionaryBeanBase implements DictionaryBean, Copyable {
027    private static final long serialVersionUID = 4334492273538657771L;
028
029    protected String namespaceCode;
030    protected String componentCode;
031
032    public DictionaryBeanBase() {}
033
034    /**
035     * @see DictionaryBean#getNamespaceCode()
036     */
037    @Override
038    @BeanTagAttribute(name = "namespaceCode")
039    public String getNamespaceCode() {
040        return namespaceCode;
041    }
042
043    /**
044     * Setter for the bean's associated namespace code
045     *
046     * @param namespaceCode
047     */
048    public void setNamespaceCode(String namespaceCode) {
049        this.namespaceCode = namespaceCode;
050    }
051
052    /**
053     * @see DictionaryBean#getComponentCode()
054     */
055    @Override
056    @BeanTagAttribute(name = "componentCode")
057    public String getComponentCode() {
058        return componentCode;
059    }
060
061    /**
062     * Setter for the bean's associated component code
063     *
064     * @param componentCode
065     */
066    public void setComponentCode(String componentCode) {
067        this.componentCode = componentCode;
068    }
069
070    /**
071     * @see Copyable#clone()
072     */
073    @Override
074    public DictionaryBeanBase clone() throws CloneNotSupportedException {
075        return (DictionaryBeanBase) super.clone();
076    }
077
078    /**
079     * @see Copyable#copy()
080     * @see CopyUtils#copy(Copyable)
081     */
082    public <T> T copy() {
083        return CopyUtils.copy(this);
084    }
085
086    @Override
087    public void dataDictionaryPostProcessing() {
088        // Do nothing here - will be implemented by subclasses
089    }
090}