|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.appfuse.webapp.spring.ValidatorExtensionPostProcessor
public class ValidatorExtensionPostProcessor
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 Summary | |
|---|---|
ValidatorExtensionPostProcessor()
|
|
| Method Summary | |
|---|---|
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(java.util.List validationConfigLocations)
The list of validation config locations to be added to the validator factory. |
void |
setValidatorFactoryBeanName(java.lang.String validatorFactoryBeanName)
Set the name of the validator factory bean. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ValidatorExtensionPostProcessor()
| Method Detail |
|---|
public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory configurableListableBeanFactory)
throws org.springframework.beans.BeansException
postProcessBeanFactory in interface org.springframework.beans.factory.config.BeanFactoryPostProcessororg.springframework.beans.BeansExceptionpublic void setValidatorFactoryBeanName(java.lang.String validatorFactoryBeanName)
validatorFactoryBeanName - The validator factory bean name.public void setValidationConfigLocations(java.util.List validationConfigLocations)
validationConfigLocations - The list of additional validation configuration locations.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||