1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.fp.document.service.impl;
17
18 import org.kuali.ole.fp.document.service.TransferOfFundsService;
19 import org.kuali.ole.sys.context.SpringContext;
20 import org.kuali.ole.sys.document.validation.impl.AccountingDocumentRuleBaseConstants.APPLICATION_PARAMETER;
21 import org.kuali.ole.sys.service.impl.OleParameterConstants;
22 import org.kuali.rice.core.api.parameter.ParameterEvaluator;
23 import org.kuali.rice.core.api.parameter.ParameterEvaluatorService;
24 import org.kuali.rice.coreservice.framework.parameter.ParameterService;
25
26
27
28
29 public class TransferOfFundsServiceImpl implements TransferOfFundsService {
30 private ParameterService parameterService;
31
32
33
34
35 public boolean isMandatoryTransfersSubType(String objectSubTypeCode) {
36 return checkMandatoryTransfersSubType(objectSubTypeCode, APPLICATION_PARAMETER.MANDATORY_TRANSFER_SUBTYPE_CODES);
37 }
38
39
40
41
42 public boolean isNonMandatoryTransfersSubType(String objectSubTypeCode) {
43 return checkMandatoryTransfersSubType(objectSubTypeCode, APPLICATION_PARAMETER.NONMANDATORY_TRANSFER_SUBTYPE_CODES);
44 }
45
46
47
48
49
50
51
52
53 protected boolean checkMandatoryTransfersSubType(String objectSubTypeCode, String parameterName) {
54 if (objectSubTypeCode == null) {
55 throw new IllegalArgumentException("An illegal argument has been passed. Cannot allow (null) subtypes.");
56 }
57 ParameterEvaluator evaluator = SpringContext.getBean(ParameterEvaluatorService.class).getParameterEvaluator(OleParameterConstants.FINANCIAL_PROCESSING_DOCUMENT.class, parameterName, objectSubTypeCode);
58 boolean returnboolean = evaluator.evaluationSucceeds();
59 return returnboolean;
60 }
61
62
63
64
65
66 public ParameterService getParameterService() {
67 return parameterService;
68 }
69
70
71
72
73
74 public void setParameterService(ParameterService parameterService) {
75 this.parameterService = parameterService;
76 }
77 }