Coverage Report - org.kuali.rice.krms.impl.validation.ValidationWarningActionTypeServiceImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
ValidationWarningActionTypeServiceImpl
0%
0/10
0%
0/4
1.6
 
 1  
 /*
 2  
  * Copyright 2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 1.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/ecl1.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.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  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 30  
  */
 31  
 public class ValidationWarningActionTypeServiceImpl extends KrmsTypeServiceBase implements ValidationActionTypeService {
 32  
     private ValidationActionService validationService;
 33  
 
 34  0
     private ValidationWarningActionTypeServiceImpl() {}
 35  
 
 36  
     /**
 37  
      * Factory method for getting a {@link ActionTypeService}
 38  
      * @return a {@link ValidationActionTypeService} corresponding to the given {@link org.kuali.rice.krms.framework.type.ValidationActionType}.
 39  
      */
 40  
     public static ActionTypeService getInstance() {
 41  0
         return new ValidationWarningActionTypeServiceImpl();
 42  
     }
 43  
 
 44  
 
 45  
     /**
 46  
      * @return the configured {@link org.kuali.rice.krms.api.validation.ValidationActionService}
 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  
         // TODO EGHM translator?
 59  0
         return new ValidationAction(ValidationActionType.WARNING, actionDefinition.getTypeId(), actionDefinition.getDescription());
 60  
     }
 61  
 
 62  
     /**
 63  
      * @return the configured {@link org.kuali.rice.krms.api.validation.ValidationActionService}
 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  
 }