Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ComplexAttributeDefinition |
|
| 1.6666666666666667;1.667 |
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 | 0 | public class ComplexAttributeDefinition extends AttributeDefinitionBase{ |
28 | ||
29 | protected DataDictionaryEntry dataObjectEntry; | |
30 | ||
31 | ||
32 | /** | |
33 | * @return the dataObjectEntry | |
34 | */ | |
35 | public DataDictionaryEntry getDataObjectEntry() { | |
36 | 0 | return this.dataObjectEntry; |
37 | } | |
38 | ||
39 | /** | |
40 | * @param dataObjectEntry the dataObjectEntry to set | |
41 | */ | |
42 | public void setDataObjectEntry(DataDictionaryEntry dataObjectEntry) { | |
43 | 0 | this.dataObjectEntry = dataObjectEntry; |
44 | 0 | } |
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 | 0 | if (getDataObjectEntry() == null){ |
53 | 0 | throw new AttributeValidationException("complex property '" + getName() + "' in class '" |
54 | + rootObjectClass.getName() + " does not have a dataObjectClass defined"); | |
55 | ||
56 | } | |
57 | 0 | } |
58 | ||
59 | } |