Coverage Report - com.buckosoft.PicMan.validator.DatabaseConverterValidator
 
Classes in this File Line Coverage Branch Coverage Complexity
DatabaseConverterValidator
0%
0/5
N/A
1
 
 1  
 /******************************************************************************
 2  
  * DatabaseConverterValidator.java - Check for normalcy on the parameters from the Database converter page.
 3  
  * 
 4  
  * PicMan - The BuckoSoft Picture Manager in Java
 5  
  * Copyright(c) 2006 - Dick Balaska
 6  
  * 
 7  
  */
 8  
 package com.buckosoft.PicMan.validator;
 9  
 
 10  
 import org.springframework.validation.Errors;
 11  
 import org.springframework.validation.ValidationUtils;
 12  
 import org.springframework.validation.Validator;
 13  
 
 14  
 import com.buckosoft.PicMan.web.DatabaseConverterForm;
 15  
 
 16  
 /** Check for normalcy on the parameters from the Database converter page.
 17  
  * @author Dick Balaska
 18  
  * @since 2006/09/30
 19  
  */
 20  0
 public class DatabaseConverterValidator implements Validator {
 21  
 
 22  
         @SuppressWarnings("rawtypes")
 23  
         public boolean supports(Class clazz) {
 24  0
                 return DatabaseConverterForm.class.isAssignableFrom(clazz);
 25  
         }
 26  
 
 27  
         public void validate(Object obj, Errors errors) {
 28  0
                 ValidationUtils.rejectIfEmpty(errors, "oldName", "OLD_NAME_REQUIRED", "Old name is required.");
 29  0
                 ValidationUtils.rejectIfEmpty(errors, "newName", "NEW_NAME_REQUIRED", "New name is required.");
 30  0
         }
 31  
 }