1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.krms.impl.validation; |
17 | |
|
18 | |
import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; |
19 | |
import org.kuali.rice.krms.api.repository.action.ActionDefinition; |
20 | |
import org.kuali.rice.krms.api.validation.ValidationActionService; |
21 | |
import org.kuali.rice.krms.framework.engine.Action; |
22 | |
import org.kuali.rice.krms.framework.type.ActionTypeService; |
23 | |
import org.kuali.rice.krms.framework.type.ValidationActionType; |
24 | |
import org.kuali.rice.krms.framework.type.ValidationActionTypeService; |
25 | |
import org.kuali.rice.krms.impl.type.KrmsTypeServiceBase; |
26 | |
import org.kuali.rice.krms.impl.util.KRMSServiceLocatorInternal; |
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
public class ValidationWarningActionTypeServiceImpl extends KrmsTypeServiceBase implements ValidationActionTypeService { |
32 | |
private ValidationActionService validationService; |
33 | |
|
34 | 0 | private ValidationWarningActionTypeServiceImpl() {} |
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
public static ActionTypeService getInstance() { |
41 | 0 | return new ValidationWarningActionTypeServiceImpl(); |
42 | |
} |
43 | |
|
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | |
public ValidationActionService getValidationService() { |
49 | 0 | if (validationService == null) { |
50 | 0 | validationService = KRMSServiceLocatorInternal.getValidationActionService(); |
51 | |
} |
52 | |
|
53 | 0 | return validationService; |
54 | |
} |
55 | |
|
56 | |
@Override |
57 | |
public Action loadAction(ActionDefinition actionDefinition) { |
58 | |
|
59 | 0 | return new ValidationAction(ValidationActionType.WARNING, actionDefinition.getTypeId(), actionDefinition.getDescription()); |
60 | |
} |
61 | |
|
62 | |
|
63 | |
|
64 | |
|
65 | |
public void setValidationService(ValidationActionService validationService) { |
66 | 0 | if (validationService == null) { |
67 | 0 | throw new RiceIllegalArgumentException("validationService must not be null"); |
68 | |
} |
69 | 0 | this.validationService = validationService; |
70 | 0 | } |
71 | |
} |