|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springmodules.validation.bean.conf.DefaultBeanValidationConfiguration
public class DefaultBeanValidationConfiguration
A default implementation of BeanValidationConfiguration
.
Constructor Summary | |
---|---|
DefaultBeanValidationConfiguration()
Constructs a new DefaultBeanValidationConfiguration with no rules, validatable properties, or custom validator. |
Method Summary | |
---|---|
void |
addCascadeValidation(CascadeValidation cascadeValidation)
Adds the given cascade validation to this configuration. |
void |
addCascadeValidations(CascadeValidation[] cascadeValidations)
Adds the given cascade validations to this configuration. |
void |
addCustomValidator(Validator validator)
Adds the given validator to the custom validator of this configuration. |
void |
addCustomValidators(Validator[] validators)
Adds the given validators to the custom validator of this configuration. |
void |
addGlobalRule(ValidationRule globalRule)
Adds the given rule as global rules for this configuration. |
void |
addGlobalRules(ValidationRule[] globalRules)
Adds the given rules as global rules for this configuration. |
void |
addPropertyRule(String propertyName,
ValidationRule rule)
Adds the given validation rule to the given property. |
void |
addPropertyRules(String propertyName,
ValidationRule[] extraRules)
Adds the given validation rules to the given property. |
CascadeValidation[] |
getCascadeValidations()
Returns the configured cascade validations. |
Validator |
getCustomValidator()
Returns the custom validator associated with this configuration, null if no custom validator
is associated. |
ValidationRule[] |
getGlobalRules()
Returns the global validation rules for the bean. |
ValidationRule[] |
getPropertyRules(String propertyName)
Returns the property validation rules for the bean that are associated with the given property name. |
String[] |
getValidatedProperties()
Returns a list of all properties that are associated with validation rules. |
void |
setCascadeValidations(CascadeValidation[] cascadeValidations)
Sets the cascade validations of this configuration. |
void |
setCustomValidator(Validator validator)
Sets the custom validator for this configuration. |
void |
setCustomValidators(Validator[] validators)
Sets the custom validator for this configuration. |
void |
setGlobalRules(ValidationRule[] globalRules)
Sets the global rules for this configuration. |
void |
setPropertyRules(String propertyName,
ValidationRule[] rules)
Sets the property validation rules for the given property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultBeanValidationConfiguration()
Method Detail |
---|
public ValidationRule[] getGlobalRules()
BeanValidationConfiguration
null
. If no global rule
is defined, an empty array is returned.
getGlobalRules
in interface BeanValidationConfiguration
BeanValidationConfiguration.getGlobalRules()
public void setGlobalRules(ValidationRule[] globalRules)
setGlobalRules
in interface MutableBeanValidationConfiguration
globalRules
- The global rules for this configurationpublic void addGlobalRule(ValidationRule globalRule)
addGlobalRule
in interface MutableBeanValidationConfiguration
globalRule
- The rule to be added as global rules for this configuration.public void addGlobalRules(ValidationRule[] globalRules)
addGlobalRules
in interface MutableBeanValidationConfiguration
globalRules
- The rules to be added as global rules for this configuration.public ValidationRule[] getPropertyRules(String propertyName)
BeanValidationConfiguration
null
. If no rule is associated with the given property, an empty array is returned.
getPropertyRules
in interface BeanValidationConfiguration
propertyName
- The name of the bean property.
BeanValidationConfiguration.getPropertyRules(String).
public String[] getValidatedProperties()
BeanValidationConfiguration
getValidatedProperties
in interface BeanValidationConfiguration
BeanValidationConfiguration.getValidatedProperties()
public void setPropertyRules(String propertyName, ValidationRule[] rules)
setPropertyRules
in interface MutableBeanValidationConfiguration
propertyName
- The name of the property.rules
- The validation rules for the given property.public void addPropertyRule(String propertyName, ValidationRule rule)
addPropertyRule
in interface MutableBeanValidationConfiguration
propertyName
- The name of the property.rule
- The validation rule to be added to the given property.public void addPropertyRules(String propertyName, ValidationRule[] extraRules)
addPropertyRules
in interface MutableBeanValidationConfiguration
propertyName
- The name of the property.extraRules
- The extra validation rules that will be added to the given property.public Validator getCustomValidator()
BeanValidationConfiguration
null
if no custom validator
is associated.
getCustomValidator
in interface BeanValidationConfiguration
BeanValidationConfiguration.getCustomValidator()
public CascadeValidation[] getCascadeValidations()
BeanValidationConfiguration
getCascadeValidations
in interface BeanValidationConfiguration
BeanValidationConfiguration.getCascadeValidations()
public void setCustomValidator(Validator validator)
setCustomValidator
in interface MutableBeanValidationConfiguration
validator
- The custom validator for this configuration.public void setCustomValidators(Validator[] validators)
setCustomValidators
in interface MutableBeanValidationConfiguration
validators
- The validators that will make the custom validator of this configuration.public void addCustomValidator(Validator validator)
addCustomValidator
in interface MutableBeanValidationConfiguration
validator
- The validator to be added to the custom validator of this configuration.public void addCustomValidators(Validator[] validators)
addCustomValidators
in interface MutableBeanValidationConfiguration
validators
- The validators to be added to the custom validator of this configuration.public void setCascadeValidations(CascadeValidation[] cascadeValidations)
setCascadeValidations
in interface MutableBeanValidationConfiguration
public void addCascadeValidation(CascadeValidation cascadeValidation)
addCascadeValidation
in interface MutableBeanValidationConfiguration
cascadeValidation
- The cascase validation to be added to this configuration.public void addCascadeValidations(CascadeValidation[] cascadeValidations)
addCascadeValidations
in interface MutableBeanValidationConfiguration
cascadeValidations
- The cascade validation to be added to this configuration.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |