1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.web.bind;
17
18 import org.kuali.rice.krad.uif.view.ViewModel;
19 import org.springframework.beans.BeanWrapper;
20 import org.springframework.util.Assert;
21 import org.springframework.validation.BeanPropertyBindingResult;
22
23
24
25
26
27
28 public class UifBeanPropertyBindingResult extends BeanPropertyBindingResult {
29 private static final long serialVersionUID = -3740046436620585003L;
30
31 public UifBeanPropertyBindingResult(Object target, String objectName, boolean autoGrowNestedPaths, int autoGrowCollectionLimit) {
32 super(target, objectName, autoGrowNestedPaths, autoGrowCollectionLimit);
33 }
34
35
36
37
38
39 @Override
40 protected UifViewBeanWrapper createBeanWrapper() {
41 Assert.state(super.getTarget() != null, "Cannot access properties on null bean instance '" + getObjectName() + "'!");
42 Assert.state(super.getTarget() instanceof ViewModel, "Object must be instance of ViewModel to use Uif Bean Wrapper");
43
44 return new UifViewBeanWrapper((ViewModel) super.getTarget());
45 }
46 }