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.exception.AttributeValidationException;
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
29 protected DataDictionaryEntry dataObjectEntry;
30
31 /**
32 * @return the dataObjectEntry
33 */
34 public DataDictionaryEntry getDataObjectEntry() {
35 return this.dataObjectEntry;
36 }
37
38 /**
39 * @param dataObjectEntry the dataObjectEntry to set
40 */
41 public void setDataObjectEntry(DataDictionaryEntry dataObjectEntry) {
42 this.dataObjectEntry = dataObjectEntry;
43 }
44
45 /**
46 * @see org.kuali.rice.krad.datadictionary.DataDictionaryDefinition#completeValidation(java.lang.Class,
47 * java.lang.Class)
48 */
49 @Override
50 public void completeValidation(Class<?> rootObjectClass, Class<?> otherObjectClass) {
51 if (getDataObjectEntry() == null) {
52 throw new AttributeValidationException("complex property '"
53 + getName()
54 + "' in class '"
55 + rootObjectClass.getName()
56 + " does not have a dataObjectClass defined");
57
58 }
59 }
60
61 }