/*
* Created on Dec 2, 2004
*
*/
package com.kylietech.oaj.web.validator;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;
import com.kylietech.oaj.common.util.OAServiceUtil;
import com.kylietech.oaj.extras.service.*;
import com.kylietech.oaj.impexp.DataImportProcessor;
import com.kylietech.oaj.impexp.ImpExpData;
/**
* @spring.bean
* name = "dataImportValidator"
*/
public class DataImportValidator implements Validator {
public boolean supports(Class clazz) {
return clazz.equals(ImpExpData.class);
}
public void validate(Object command, Errors errors) {
DataImportService manager = (DataImportService)OAServiceUtil.getBean("DataImportManager");
DataImportProcessor processor = manager.createProcessor((ImpExpData)command);
processor.validate(errors);
}
}