1 /* 2 * Copyright 2004-2009 the original author or authors. 3 * 4 * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0 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 17 package org.springmodules.validation.bean.conf; 18 19 import org.springframework.validation.Validator; 20 import org.springmodules.validation.bean.rule.ValidationRule; 21 22 /** 23 * A default implementation of {@link BeanValidationConfiguration}. 24 * 25 * @author Uri Boness 26 */ 27 public interface MutableBeanValidationConfiguration extends BeanValidationConfiguration { 28 29 /** 30 * Sets the global rules for this configuration. 31 * 32 * @param globalRules The global rules for this configuration 33 */ 34 void setGlobalRules(ValidationRule[] globalRules); 35 36 /** 37 * Adds the given rule as global rules for this configuration. 38 * 39 * @param globalRule The rule to be added as global rules for this configuration. 40 */ 41 void addGlobalRule(ValidationRule globalRule); 42 43 /** 44 * Adds the given rules as global rules for this configuration. 45 * 46 * @param globalRules The rules to be added as global rules for this configuration. 47 */ 48 void addGlobalRules(ValidationRule[] globalRules); 49 50 /** 51 * Sets the property validation rules for the given property. 52 * 53 * @param propertyName The name of the property. 54 * @param rules The validation rules for the given property. 55 */ 56 void setPropertyRules(String propertyName, ValidationRule[] rules); 57 58 /** 59 * Adds the given validation rule to the given property. 60 * 61 * @param propertyName The name of the property. 62 * @param rule The validation rule to be added to the given property. 63 */ 64 void addPropertyRule(String propertyName, ValidationRule rule); 65 66 /** 67 * Adds the given validation rules to the given property. 68 * 69 * @param propertyName The name of the property. 70 * @param extraRules The extra validation rules that will be added to the given property. 71 */ 72 void addPropertyRules(String propertyName, ValidationRule[] extraRules); 73 74 /** 75 * Sets the custom validator for this configuration. 76 * 77 * @param validator The custom validator for this configuration. 78 */ 79 void setCustomValidator(Validator validator); 80 81 /** 82 * Sets the custom validator for this configuration. The custom validator will be compound with the given 83 * validators. 84 * 85 * @param validators The validators that will make the custom validator of this configuration. 86 */ 87 void setCustomValidators(Validator[] validators); 88 89 /** 90 * Adds the given validator to the custom validator of this configuration. 91 * 92 * @param validator The validator to be added to the custom validator of this configuration. 93 */ 94 void addCustomValidator(Validator validator); 95 96 /** 97 * Adds the given validators to the custom validator of this configuration. 98 * 99 * @param validators The validators to be added to the custom validator of this configuration. 100 */ 101 void addCustomValidators(Validator[] validators); 102 103 /** 104 * Sets the cascade validations of this configuration. 105 * <p/> 106 * param cascadeValidations The cascade validations of this configuration. 107 */ 108 void setCascadeValidations(CascadeValidation[] cascadeValidations); 109 110 /** 111 * Adds the given cascade validation to this configuration. 112 * 113 * @param cascadeValidation The cascase validation to be added to this configuration. 114 */ 115 void addCascadeValidation(CascadeValidation cascadeValidation); 116 117 /** 118 * Adds the given cascade validations to this configuration. 119 * 120 * @param cascadeValidations The cascade validation to be added to this configuration. 121 */ 122 void addCascadeValidations(CascadeValidation[] cascadeValidations); 123 124 }