| 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 | 0 | public CollectionDefinition() {} |
| 40 | |
|
| 41 | |
public String getName() { |
| 42 | 0 | return name; |
| 43 | |
} |
| 44 | |
|
| 45 | |
public void setName(String name) { |
| 46 | 0 | if (StringUtils.isBlank(name)) { |
| 47 | 0 | throw new IllegalArgumentException("invalid (blank) name"); |
| 48 | |
} |
| 49 | 0 | this.name = name; |
| 50 | 0 | } |
| 51 | |
|
| 52 | |
public String getLabel() { |
| 53 | 0 | return label; |
| 54 | |
} |
| 55 | |
|
| 56 | |
public void setLabel(String label) { |
| 57 | 0 | if (StringUtils.isBlank(label)) { |
| 58 | 0 | throw new IllegalArgumentException("invalid (blank) label"); |
| 59 | |
} |
| 60 | 0 | this.label = label; |
| 61 | 0 | } |
| 62 | |
|
| 63 | |
|
| 64 | |
|
| 65 | |
|
| 66 | |
public String getShortLabel() { |
| 67 | 0 | return (shortLabel != null) ? shortLabel : label; |
| 68 | |
} |
| 69 | |
|
| 70 | |
public void setShortLabel(String shortLabel) { |
| 71 | 0 | if (StringUtils.isBlank(shortLabel)) { |
| 72 | 0 | throw new IllegalArgumentException("invalid (blank) shortLabel"); |
| 73 | |
} |
| 74 | 0 | this.shortLabel = shortLabel; |
| 75 | 0 | } |
| 76 | |
|
| 77 | |
|
| 78 | |
|
| 79 | |
|
| 80 | |
|
| 81 | |
public String getElementLabel() { |
| 82 | 0 | return elementLabel; |
| 83 | |
} |
| 84 | |
|
| 85 | |
|
| 86 | |
|
| 87 | |
|
| 88 | |
|
| 89 | |
|
| 90 | |
public void setElementLabel(String elementLabel) { |
| 91 | 0 | this.elementLabel = elementLabel; |
| 92 | 0 | } |
| 93 | |
|
| 94 | |
public String getSummary() { |
| 95 | 0 | return summary; |
| 96 | |
} |
| 97 | |
|
| 98 | |
|
| 99 | |
|
| 100 | |
|
| 101 | |
|
| 102 | |
public void setSummary(String summary) { |
| 103 | 0 | this.summary = summary; |
| 104 | 0 | } |
| 105 | |
|
| 106 | |
public String getDescription() { |
| 107 | 0 | return description; |
| 108 | |
} |
| 109 | |
|
| 110 | |
|
| 111 | |
|
| 112 | |
|
| 113 | |
|
| 114 | |
public void setDescription(String description) { |
| 115 | 0 | this.description = description; |
| 116 | 0 | } |
| 117 | |
|
| 118 | |
|
| 119 | |
|
| 120 | |
|
| 121 | |
|
| 122 | |
|
| 123 | |
|
| 124 | |
public void completeValidation(Class rootBusinessObjectClass, Class otherBusinessObjectClass) { |
| 125 | 0 | if (!DataDictionary.isCollectionPropertyOf(rootBusinessObjectClass, name)) { |
| 126 | 0 | throw new AttributeValidationException("property '" + name + "' is not a collection property of class '" + rootBusinessObjectClass + "' (" + "" + ")"); |
| 127 | |
} |
| 128 | 0 | } |
| 129 | |
|
| 130 | |
|
| 131 | |
|
| 132 | |
|
| 133 | |
|
| 134 | |
public String toString() { |
| 135 | 0 | return "CollectionDefinition for collection " + getName(); |
| 136 | |
} |
| 137 | |
} |