1 /** 2 * Copyright 2005-2012 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.service; 17 18 import org.kuali.rice.krad.datadictionary.validation.result.DictionaryValidationResult; 19 import org.kuali.rice.krad.uif.view.View; 20 import org.kuali.rice.krad.uif.view.ViewModel; 21 22 23 /** 24 * Validation service for KRAD views 25 * 26 * @author Kuali Rice Team (rice.collab@kuali.org) 27 */ 28 public interface ViewValidationService { 29 30 /** 31 * This is the main validation method that should be used when validating Views 32 * Validates the view based on the model passed in, this will correctly use previousView by default 33 * as it automatically contains the generated data the validation requires. 34 * @param model 35 * @return DictionaryValidationResult that contains any errors/messages if any, messages will have already 36 * been added to the MessageMap 37 */ 38 public DictionaryValidationResult validateView(ViewModel model); 39 40 /** 41 * Additional validation method when you want to explicitly define the View being validated. Note 42 * that the view must have the correct binding information on its InputFields already generated by 43 * its lifecycle for this method to be used correctly. 44 * @param view 45 * @param model 46 * @return DictionaryValidationResult that contains any errors/messages if any,, messages will have already 47 * been added to the MessageMap 48 */ 49 public DictionaryValidationResult validateView(View view, ViewModel model); 50 51 }