View Javadoc
1   /**
2    * Copyright 2005-2016 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.validator.ValidationTrace;
19  
20  /**
21   * A complex attribute definition in the DataDictictionary. This can be be used to define
22   * an attribute for a DataObjectEntry's attribute list which is represented by another
23   * object entry definition. It will
24   *
25   * @author Kuali Rice Team (rice.collab@kuali.org)
26   */
27  public class ComplexAttributeDefinition extends AttributeDefinitionBase {
28      private static final long serialVersionUID = 3977923609388434447L;
29  
30      protected DataDictionaryEntry dataObjectEntry;
31  
32      /**
33       * @return the dataObjectEntry
34       */
35      public DataDictionaryEntry getDataObjectEntry() {
36          return this.dataObjectEntry;
37      }
38  
39      /**
40       * @param dataObjectEntry the dataObjectEntry to set
41       */
42      public void setDataObjectEntry(DataDictionaryEntry dataObjectEntry) {
43          this.dataObjectEntry = dataObjectEntry;
44      }
45  
46      public void completeValidation(Class<?> rootObjectClass, Class<?> otherObjectClass, ValidationTrace tracer) {
47          tracer.addBean(this.getClass().getSimpleName(), "id: " + getId());
48          if (getDataObjectEntry() == null) {
49              String currentValues[] = {"id = " + getId(), "class = " + rootObjectClass.getName()};
50              tracer.createError("ComplexAttributeDefinition missing dataObjectClass", currentValues);
51          }
52      }
53  }