Coverage Report - org.kuali.student.r2.common.datadictionary.DataDictionaryValidator
 
Classes in this File Line Coverage Branch Coverage Complexity
DataDictionaryValidator
N/A
N/A
3
DataDictionaryValidator$ValidationType
0%
0/6
0%
0/4
3
 
 1  
 /*
 2  
  * To change this template, choose Tools | Templates
 3  
  * and open the template in the editor.
 4  
  */
 5  
 
 6  
 package org.kuali.student.r2.common.datadictionary;
 7  
 
 8  
 import java.util.List;
 9  
 import org.kuali.student.r2.common.dto.ContextInfo;
 10  
 import org.kuali.student.r2.common.dto.ValidationResultInfo;
 11  
 import org.kuali.student.r2.common.exceptions.InvalidParameterException;
 12  
 import org.kuali.student.r2.common.exceptions.MissingParameterException;
 13  
 import org.kuali.student.r2.common.exceptions.OperationFailedException;
 14  
 import org.kuali.student.r2.common.exceptions.PermissionDeniedException;
 15  
 
 16  
 /**
 17  
  *
 18  
  * @author nwright
 19  
  */
 20  
 public interface DataDictionaryValidator {
 21  
 
 22  0
     public static enum ValidationType {
 23  0
         FULL_VALIDATION, SKIP_REQUREDNESS_VALIDATIONS;
 24  
 
 25  
         public static ValidationType fromString (String str)
 26  
           throws InvalidParameterException {
 27  0
             for (ValidationType vt : ValidationType.values()) {
 28  0
                 if (vt.name().equals(str)) {
 29  0
                     return vt;
 30  
                 }
 31  
             }
 32  0
             throw new InvalidParameterException ("validationType");
 33  
         }
 34  
     }
 35  
 
 36  
     /**
 37  
      * Generic validation interface used to implement the individual validateXXXX (xxxxx) methods
 38  
      * 
 39  
      * This is not supposed to remotable because it's object is an Object.
 40  
      *
 41  
      * @param validationType, FULL_VALIDATION or SKIP_REQUIREDNESS_VALIDATIONS
 42  
      * @param info object to be validated
 43  
      * @param context of user and locale information
 44  
      * @return list of validation results
 45  
      */
 46  
     public List<ValidationResultInfo> validate (ValidationType validationType, Object info, ContextInfo context)
 47  
       throws OperationFailedException, MissingParameterException, InvalidParameterException, PermissionDeniedException;
 48  
 }