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 public class ComplexAttributeDefinitionConstraintProvider extends BaseConstraintProvider<ComplexAttributeDefinition> {
34
35 @Override
36 public void init() {
37 resolverMap = new HashMap<String, ConstraintResolver<ComplexAttributeDefinition>>();
38 resolverMap.put(ExistenceConstraint.class.getName(), new DefinitionConstraintResolver<ComplexAttributeDefinition>());
39 }
40
41
42
43
44 @Override
45 public boolean isSupported(Constrainable definition) {
46
47 if (definition instanceof ComplexAttributeDefinition)
48 return true;
49
50 return false;
51 }
52
53 }