1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.datadictionary.validation.constraint.provider;
17
18 import org.kuali.rice.krad.datadictionary.ComplexAttributeDefinition;
19 import org.kuali.rice.krad.datadictionary.validation.capability.Constrainable;
20 import org.kuali.rice.krad.datadictionary.validation.constraint.ExistenceConstraint;
21 import org.kuali.rice.krad.datadictionary.validation.constraint.resolver.ConstraintResolver;
22 import org.kuali.rice.krad.datadictionary.validation.constraint.resolver.DefinitionConstraintResolver;
23
24 import java.util.HashMap;
25
26
27
28
29
30
31
32
33
34
35 public class ComplexAttributeDefinitionConstraintProvider extends BaseConstraintProvider<ComplexAttributeDefinition> {
36
37 @Override
38 public void init() {
39 resolverMap = new HashMap<String, ConstraintResolver<ComplexAttributeDefinition>>();
40 resolverMap.put(ExistenceConstraint.class.getName(),
41 new DefinitionConstraintResolver<ComplexAttributeDefinition>());
42 }
43
44
45
46
47 @Override
48 public boolean isSupported(Constrainable definition) {
49
50 if (definition instanceof ComplexAttributeDefinition) {
51 return true;
52 }
53
54 return false;
55 }
56
57 }