Package org.dellroad.stuff.pobj
Class SpringXSLUpdateTransformConfigurer
java.lang.Object
org.dellroad.stuff.pobj.SpringXSLUpdateTransformConfigurer
- All Implemented Interfaces:
Aware,BeanPostProcessor,ResourceLoaderAware
public class SpringXSLUpdateTransformConfigurer
extends Object
implements BeanPostProcessor, ResourceLoaderAware
Spring
BeanPostProcessor that looks for SpringXSLPersistentObjectSchemaUpdate beans that don't have
an explicit transform resource configured, and configures
them using a resource location based on the bean name, by simply adding a configured prefix and suffix.
In addition, this class will optionally configure the transformerFactory property of all of the
SpringXSLPersistentObjectSchemaUpdate beans it finds that don't already have one explicitly configured.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetImpliedTransformResourceLocation(String beanName) Derive the implied transform resource location for the update with the given bean name.postProcessAfterInitialization(Object bean, String beanName) postProcessBeforeInitialization(Object bean, String beanName) voidSet the location prefix.voidsetResourceLoader(ResourceLoader resourceLoader) voidSet the location suffix.voidsetTransformerFactory(TransformerFactory transformerFactory) Set theTransformerFactoryto configure all updates with.
-
Field Details
-
DEFAULT_LOCATION_PREFIX
Default location prefix:"/".- See Also:
-
DEFAULT_LOCATION_SUFFIX
Default location suffix:".xsl".- See Also:
-
-
Constructor Details
-
SpringXSLUpdateTransformConfigurer
public SpringXSLUpdateTransformConfigurer()
-
-
Method Details
-
setPrefix
Set the location prefix.- Parameters:
prefix- prefix to apply to bean names
-
setSuffix
Set the location suffix.- Parameters:
suffix- suffix to apply to bean names
-
setTransformerFactory
Set theTransformerFactoryto configure all updates with.This property is optional.
- Parameters:
transformerFactory- custom factory for XSL transformers, or null for none
-
setResourceLoader
- Specified by:
setResourceLoaderin interfaceResourceLoaderAware
-
postProcessBeforeInitialization
- Specified by:
postProcessBeforeInitializationin interfaceBeanPostProcessor
-
postProcessAfterInitialization
- Specified by:
postProcessAfterInitializationin interfaceBeanPostProcessor
-
getImpliedTransformResourceLocation
Derive the implied transform resource location for the update with the given bean name.The implementation in
SpringXSLUpdateTransformConfigurersimply prepends the configured prefix and appends the configured suffix tobeanName.- Parameters:
beanName- schema update bean name- Returns:
- schema update resource location
-