View Javadoc

1   /**
2    * Copyright 2005-2011 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  	/**
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  
47  	/**
48  	 * @see org.kuali.rice.krad.datadictionary.DataDictionaryDefinition#completeValidation(java.lang.Class, java.lang.Class)
49  	 */
50  	@Override
51  	public void completeValidation(Class<?> rootObjectClass, Class<?> otherObjectClass) {
52  		if (getDataObjectEntry() == null){
53  			throw new AttributeValidationException("complex property '" + getName() + "' in class '"
54  					+ rootObjectClass.getName() + " does not have a dataObjectClass defined");
55  			
56  		}
57  	}
58  
59  }