Coverage Report - org.kuali.rice.krad.datadictionary.validation.processor.MandatoryElementConstraintProcessor
 
Classes in this File Line Coverage Branch Coverage Complexity
MandatoryElementConstraintProcessor
8%
1/12
0%
0/4
1.4
 
 1  
 /**
 2  
  * Copyright 2005-2011 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.krad.datadictionary.validation.processor;
 17  
 
 18  
 import org.kuali.rice.core.api.CoreApiServiceLocator;
 19  
 import org.kuali.rice.core.api.datetime.DateTimeService;
 20  
 import org.kuali.rice.krad.datadictionary.validation.constraint.Constraint;
 21  
 import org.kuali.rice.krad.service.DataDictionaryService;
 22  
 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
 23  
 
 24  
 /**
 25  
  * This abstract class can be extended by constraint processor classes that
 26  
  * must be processed on every validation.  
 27  
  * 
 28  
  * @author Kuali Rice Team (rice.collab@kuali.org) 
 29  
  */
 30  261
 public abstract class MandatoryElementConstraintProcessor<C extends Constraint> implements ConstraintProcessor<Object, C> {
 31  
 
 32  
         protected DataDictionaryService dataDictionaryService;
 33  
         protected DateTimeService dateTimeService;
 34  
         
 35  
         
 36  
         /**
 37  
          * @see org.kuali.rice.krad.datadictionary.validation.processor.ConstraintProcessor#isOptional()
 38  
          */
 39  
         @Override
 40  
         public boolean isOptional() {
 41  0
                 return false;
 42  
         }
 43  
 
 44  
         /**
 45  
          * @return the dataDictionaryService
 46  
          */
 47  
         public DataDictionaryService getDataDictionaryService() {
 48  0
                 if (dataDictionaryService == null)
 49  0
                         dataDictionaryService = KRADServiceLocatorWeb.getDataDictionaryService();
 50  0
                 return this.dataDictionaryService;
 51  
         }
 52  
 
 53  
         /**
 54  
          * @param dataDictionaryService the dataDictionaryService to set
 55  
          */
 56  
         public void setDataDictionaryService(DataDictionaryService dataDictionaryService) {
 57  0
                 this.dataDictionaryService = dataDictionaryService;
 58  0
         }
 59  
         
 60  
         /**
 61  
          * @return the dateTimeService
 62  
          */
 63  
         public DateTimeService getDateTimeService() {
 64  0
                 if (dateTimeService == null)
 65  0
                         dateTimeService = CoreApiServiceLocator.getDateTimeService();
 66  
                 
 67  0
                 return this.dateTimeService;
 68  
         }
 69  
 
 70  
         /**
 71  
          * @param dateTimeService the dateTimeService to set
 72  
          */
 73  
         public void setDateTimeService(DateTimeService dateTimeService) {
 74  0
                 this.dateTimeService = dateTimeService;
 75  0
         }
 76  
         
 77  
 }