1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.datadictionary;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.krad.bo.BusinessObject;
20 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
21 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
22 import org.kuali.rice.krad.datadictionary.validator.ValidationTrace;
23
24
25
26
27
28
29 @BeanTag(name = "inactivationBlockingDefinition-bean")
30 public class InactivationBlockingDefinition extends DataDictionaryDefinitionBase implements InactivationBlockingMetadata {
31 private static final long serialVersionUID = -8765429636173190984L;
32
33 protected Class<?> blockingReferenceBusinessObjectClass;
34 protected String blockedReferencePropertyName;
35 protected Class<?> blockedBusinessObjectClass;
36 protected String inactivationBlockingDetectionServiceBeanName;
37 protected String relationshipLabel;
38 protected Class<?> businessObjectClass;
39
40 @Override
41 public void completeValidation(Class<?> rootDataObjectClass, Class<?> otherDataObjectClass, ValidationTrace tracer) {
42 if (StringUtils.isBlank(inactivationBlockingDetectionServiceBeanName)) {
43 if (StringUtils.isBlank(blockedReferencePropertyName)) {
44
45 String currentValues[] = {"rootDataObjectClass = " + rootDataObjectClass};
46 tracer.createError("inactivationBlockingDetectionServiceBeanName and blockedReferencePropertyName can't both be blank in InactivationBlockingDefinition", currentValues);
47 }
48 }
49 if (getBlockedDataObjectClass() == null) {
50 String currentValues[] = {"rootDataObjectClass = " + rootDataObjectClass};
51 tracer.createError("Unable to determine blockedReferenceBusinessObjectClass in InactivationBlockingDefinition", currentValues);
52 }
53 }
54
55 @Override
56 @Deprecated
57 @BeanTagAttribute(name = "blockedReferencePropertyName")
58 public String getBlockedReferencePropertyName() {
59 return this.blockedReferencePropertyName;
60 }
61
62
63
64
65 @Deprecated
66 public void setBlockedReferencePropertyName(String blockedReferencePropertyName) {
67 this.blockedReferencePropertyName = blockedReferencePropertyName;
68 }
69
70 @Override
71 @BeanTagAttribute(name = "blockedAttributeName")
72 public String getBlockedAttributeName() {
73 return this.blockedReferencePropertyName;
74 }
75
76 public void setBlockedAttributeName(String blockedAttributeName) {
77 this.blockedReferencePropertyName = blockedAttributeName;
78 }
79
80 @Override
81 @Deprecated
82 @SuppressWarnings("unchecked")
83 @BeanTagAttribute(name = "blockedBusinessObjectClass")
84 public Class<? extends BusinessObject> getBlockedBusinessObjectClass() {
85 return (Class<? extends BusinessObject>)blockedBusinessObjectClass;
86 }
87
88
89
90
91 @Deprecated
92 public void setBlockedBusinessObjectClass(Class<? extends BusinessObject> blockedBusinessObjectClass) {
93 this.blockedBusinessObjectClass = blockedBusinessObjectClass;
94 }
95
96 @Override
97 @BeanTagAttribute(name = "blockedDataObjectClass")
98 public Class<?> getBlockedDataObjectClass() {
99 return blockedBusinessObjectClass;
100 }
101
102 public void setBlockedDataObjectClass(Class<?> blockedDataObjectClass) {
103 this.blockedBusinessObjectClass = blockedDataObjectClass;
104 }
105
106 @Override
107 @BeanTagAttribute(name = "inactivationBlockingDetectionServiceBeanName")
108 public String getInactivationBlockingDetectionServiceBeanName() {
109 return this.inactivationBlockingDetectionServiceBeanName;
110 }
111
112 public void setInactivationBlockingDetectionServiceBeanName(String inactivationBlockingDetectionServiceImpl) {
113 this.inactivationBlockingDetectionServiceBeanName = inactivationBlockingDetectionServiceImpl;
114 }
115
116 @Override
117 @Deprecated
118 @SuppressWarnings("unchecked")
119 @BeanTagAttribute(name = "blockingReferenceBusinessObjectClass")
120 public Class<? extends BusinessObject> getBlockingReferenceBusinessObjectClass() {
121 return (Class<? extends BusinessObject>)this.blockingReferenceBusinessObjectClass;
122 }
123
124
125
126
127 @Deprecated
128 public void setBlockingReferenceBusinessObjectClass(
129 Class<? extends BusinessObject> blockingReferenceBusinessObjectClass) {
130 this.blockingReferenceBusinessObjectClass = blockingReferenceBusinessObjectClass;
131 }
132
133 @Override
134 @BeanTagAttribute(name = "blockingDataObjectClass")
135 public Class<?> getBlockingDataObjectClass() {
136 return blockingReferenceBusinessObjectClass;
137 }
138
139 public void setBlockingReferenceDataObjectClass(Class<?> blockingDataObjectClass) {
140 this.blockingReferenceBusinessObjectClass = blockingDataObjectClass;
141 }
142
143 @Override
144 @BeanTagAttribute(name = "relationshipLabel")
145 public String getRelationshipLabel() {
146 return this.relationshipLabel;
147 }
148
149 public void setRelationshipLabel(String relationshipLabel) {
150 this.relationshipLabel = relationshipLabel;
151 }
152
153
154
155
156
157 @Deprecated
158 @SuppressWarnings("unchecked")
159 @BeanTagAttribute(name = "businessObjectClass")
160 public Class<? extends BusinessObject> getBusinessObjectClass() {
161 return (Class<? extends BusinessObject>)this.businessObjectClass;
162 }
163
164
165
166
167
168 @Deprecated
169 public void setBusinessObjectClass(Class<? extends BusinessObject> businessObjectClass) {
170 this.businessObjectClass = businessObjectClass;
171 }
172
173 @Override
174 public String toString() {
175 return "InactivationBlockingDefinition: blockedClass="
176 + blockedBusinessObjectClass.getName()
177 + " /blockingReferenceProperty="
178 + blockedReferencePropertyName
179 + " /blockingClass="
180 + blockingReferenceBusinessObjectClass.getName();
181 }
182 }