1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.rice.kns.datadictionary;
18
19 import org.apache.commons.lang.StringUtils;
20 import org.kuali.rice.kns.datadictionary.exception.AttributeValidationException;
21
22
23
24
25
26
27
28 public class CollectionDefinition extends DataDictionaryDefinitionBase {
29 private static final long serialVersionUID = -2644072136271281041L;
30
31 protected String name;
32 protected String label;
33 protected String shortLabel;
34 protected String elementLabel;
35
36 protected String summary;
37 protected String description;
38
39 public CollectionDefinition() {}
40
41 public String getName() {
42 return name;
43 }
44
45 public void setName(String name) {
46 if (StringUtils.isBlank(name)) {
47 throw new IllegalArgumentException("invalid (blank) name");
48 }
49 this.name = name;
50 }
51
52 public String getLabel() {
53 return label;
54 }
55
56 public void setLabel(String label) {
57 if (StringUtils.isBlank(label)) {
58 throw new IllegalArgumentException("invalid (blank) label");
59 }
60 this.label = label;
61 }
62
63
64
65
66 public String getShortLabel() {
67 return (shortLabel != null) ? shortLabel : label;
68 }
69
70 public void setShortLabel(String shortLabel) {
71 if (StringUtils.isBlank(shortLabel)) {
72 throw new IllegalArgumentException("invalid (blank) shortLabel");
73 }
74 this.shortLabel = shortLabel;
75 }
76
77
78
79
80
81 public String getElementLabel() {
82 return elementLabel;
83 }
84
85
86
87
88
89
90 public void setElementLabel(String elementLabel) {
91 this.elementLabel = elementLabel;
92 }
93
94 public String getSummary() {
95 return summary;
96 }
97
98
99
100
101
102 public void setSummary(String summary) {
103 this.summary = summary;
104 }
105
106 public String getDescription() {
107 return description;
108 }
109
110
111
112
113
114 public void setDescription(String description) {
115 this.description = description;
116 }
117
118
119
120
121
122
123
124 public void completeValidation(Class rootBusinessObjectClass, Class otherBusinessObjectClass) {
125 if (!DataDictionary.isCollectionPropertyOf(rootBusinessObjectClass, name)) {
126 throw new AttributeValidationException("property '" + name + "' is not a collection property of class '" + rootBusinessObjectClass + "' (" + "" + ")");
127 }
128 }
129
130
131
132
133
134 public String toString() {
135 return "CollectionDefinition for collection " + getName();
136 }
137 }