Clover Coverage Report - krad-web-framework 2.0.0-SNAPSHOT
Coverage timestamp: Wed Dec 31 1969 19:00:00 EST
../../../../../../img/srcFileCovDistChart0.png 0% of files have more coverage
9   87   7   1.5
2   31   0.78   6
6     1.17  
1    
 
  AddAdHocRoutePersonEvent       Line # 29 9 0% 7 17 0% 0.0
 
No Tests
 
1    /*
2    * Copyright 2006-2007 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10    * Unless required by applicable law or agreed to in writing, software
11    * distributed under the License is distributed on an "AS IS" BASIS,
12    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13    * See the License for the specific language governing permissions and
14    * limitations under the License.
15    */
16    package org.kuali.rice.kns.rule.event;
17   
18    import org.kuali.rice.kns.bo.AdHocRoutePerson;
19    import org.kuali.rice.kns.document.Document;
20    import org.kuali.rice.kns.rule.AddAdHocRoutePersonRule;
21    import org.kuali.rice.kns.rule.BusinessRule;
22   
23    /**
24    * This class represents the add AdHocRoutePerson event that is part of an eDoc in Kuali. This is triggered when a user presses the
25    * add button for a given adHocRoutePerson.
26    *
27    *
28    */
 
29    public final class AddAdHocRoutePersonEvent extends KualiDocumentEventBase {
30    private AdHocRoutePerson adHocRoutePerson;
31   
32    /**
33    * Constructs an AddAdHocRoutePersonEvent with the specified errorPathPrefix, document, and adHocRoutePerson
34    *
35    * @param document
36    * @param adHocRoutePerson
37    * @param errorPathPrefix
38    */
 
39  0 toggle public AddAdHocRoutePersonEvent(String errorPathPrefix, Document document, AdHocRoutePerson adHocRoutePerson) {
40  0 super("creating add ad hoc route person event for document " + KualiDocumentEventBase.getDocumentId(document), errorPathPrefix, document);
41  0 this.adHocRoutePerson = adHocRoutePerson;
42    }
43   
44    /**
45    * Constructs an AddAdHocRoutePersonEvent with the given document
46    *
47    * @param document
48    * @param adHocRoutePerson
49    */
 
50  0 toggle public AddAdHocRoutePersonEvent(Document document, AdHocRoutePerson adHocRoutePerson) {
51  0 this("", document, adHocRoutePerson);
52    }
53   
54    /**
55    * This method retrieves the document adHocRoutePerson associated with this event.
56    *
57    * @return AdHocRoutePerson
58    */
 
59  0 toggle public AdHocRoutePerson getAdHocRoutePerson() {
60  0 return adHocRoutePerson;
61    }
62   
63    /**
64    * @see org.kuali.rice.kns.rule.event.KualiDocumentEvent#validate()
65    */
 
66  0 toggle @Override
67    public void validate() {
68  0 super.validate();
69  0 if (this.adHocRoutePerson == null) {
70  0 throw new IllegalArgumentException("invalid (null) document adHocRoutePerson");
71    }
72    }
73   
74    /**
75    * @see org.kuali.rice.kns.rule.event.KualiDocumentEvent#getRuleInterfaceClass()
76    */
 
77  0 toggle public Class<? extends BusinessRule> getRuleInterfaceClass() {
78  0 return AddAdHocRoutePersonRule.class;
79    }
80   
81    /**
82    * @see org.kuali.rice.kns.rule.event.KualiDocumentEvent#invokeRuleMethod(org.kuali.rice.kns.rule.BusinessRule)
83    */
 
84  0 toggle public boolean invokeRuleMethod(BusinessRule rule) {
85  0 return ((AddAdHocRoutePersonRule) rule).processAddAdHocRoutePerson(getDocument(), this.adHocRoutePerson);
86    }
87    }