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;
17  
18  import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
19  import org.kuali.rice.krad.datadictionary.validator.ValidationTrace;
20  
21  /**
22   * Common base class for DataDictionaryDefinition types.
23   *
24   * @author Kuali Rice Team (rice.collab@kuali.org)
25   */
26  abstract public class DataDictionaryDefinitionBase extends DictionaryBeanBase implements DataDictionaryDefinition {
27      private static final long serialVersionUID = -2003626577498716712L;
28  
29      protected String id;
30      protected boolean embeddedDataObjectMetadata = false;
31      protected boolean generatedFromMetadata = false;
32  
33      public DataDictionaryDefinitionBase() {
34      }
35  
36      @Override
37      @BeanTagAttribute(name = "id")
38      public String getId() {
39          return this.id;
40      }
41  
42      /**
43       * A unique identifier for this data dictionary element.
44       */
45      public void setId(String id) {
46          this.id = id;
47      }
48  
49      /**
50       *
51       * Returns true if the given object contains an embedded KRAD Data metadata object
52       * which may be used for defaulting certain attributes.
53       */
54      public boolean hasEmbeddedDataObjectMetadata() {
55          return embeddedDataObjectMetadata;
56      }
57  
58      /**
59       * Returns true if this data dictionary object was completely generated from
60       * KRAD Data metadata.
61       */
62      public boolean wasGeneratedFromMetadata() {
63          return generatedFromMetadata;
64      }
65  
66      public void setEmbeddedDataObjectMetadata(boolean embeddedDataObjectMetadata) {
67          this.embeddedDataObjectMetadata = embeddedDataObjectMetadata;
68      }
69  
70      public void setGeneratedFromMetadata(boolean generatedFromMetadata) {
71          this.generatedFromMetadata = generatedFromMetadata;
72      }
73  
74      /**
75       * Default implementation so that all subclasses do not need to implement this deprecated method.
76       */
77      @Override
78      @Deprecated
79      public void completeValidation(Class<?> rootBusinessObjectClass, Class<?> otherBusinessObjectClass) {
80          completeValidation(rootBusinessObjectClass, otherBusinessObjectClass, new ValidationTrace());
81      }
82  
83      /**
84       * Empty implementation so that all subclasses do not need to implement this method if they have no local validation to perform.
85       */
86      @Override
87      public void completeValidation(Class<?> rootBusinessObjectClass, Class<?> otherBusinessObjectClass, ValidationTrace tracer) {}
88  }