public class ValidatorExtensionPostProcessor extends Object implements org.springframework.beans.factory.config.BeanFactoryPostProcessor
Adds commons validator configuration files to an existing Spring commons Validator Factory bean, possibly defined within a seperate Spring configuration file in a seperate jar file. By using this extension factory developers can add validation configuration for their own persistent classes to an AppFuse application without modifying any of the existing AppFuse Spring configuration or jar distribution files.
As an example consider the following Spring bean configuration:
<bean class="org.appfuse.webapp.spring.ValidatorExtensionPostProcessor">
<property name="validationConfigLocations">
<list>
<value>/WEB-INF/foo-validation.xml</value>
</list>
</property>
</bean>
The sample adds a single validation configuration file (foo-validation.xml) to an existing Spring commons Validator Factory bean (a bean of class org.springmodules.validation.commons.DefaultValidatorFactory). Assuming the validator extension is included in a Spring configuration file called applicationContext-foo-validation.xml, and that this configuration file is added directly below WEB-INF in the Foo web project, then the normal war overlay process coupled with AppFuse's configuration file auto detection will ensure that the validation extension is automatically included into the application without requiring any modification of AppFuse's existing config files.
| Constructor and Description |
|---|
ValidatorExtensionPostProcessor() |
| Modifier and Type | Method and Description |
|---|---|
void |
postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory configurableListableBeanFactory)
Adds the validation configuration files to the list already held in the validator factory bean configuration.
|
void |
setValidationConfigLocations(List validationConfigLocations)
The list of validation config locations to be added to the validator factory.
|
void |
setValidatorFactoryBeanName(String validatorFactoryBeanName)
Set the name of the validator factory bean.
|
public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory configurableListableBeanFactory)
postProcessBeanFactory in interface org.springframework.beans.factory.config.BeanFactoryPostProcessorconfigurableListableBeanFactory - the bean factorypublic void setValidatorFactoryBeanName(String validatorFactoryBeanName)
validatorFactoryBeanName - The validator factory bean name.public void setValidationConfigLocations(List validationConfigLocations)
validationConfigLocations - The list of additional validation configuration locations.Copyright © 2003-2012. All Rights Reserved.