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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
getImpliedTransformResourceLocation
(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) void
Set the location prefix.void
setResourceLoader
(ResourceLoader resourceLoader) void
Set the location suffix.void
setTransformerFactory
(TransformerFactory transformerFactory) Set theTransformerFactory
to 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 theTransformerFactory
to configure all updates with.This property is optional.
- Parameters:
transformerFactory
- custom factory for XSL transformers, or null for none
-
setResourceLoader
- Specified by:
setResourceLoader
in interfaceResourceLoaderAware
-
postProcessBeforeInitialization
- Specified by:
postProcessBeforeInitialization
in interfaceBeanPostProcessor
-
postProcessAfterInitialization
- Specified by:
postProcessAfterInitialization
in interfaceBeanPostProcessor
-
getImpliedTransformResourceLocation
Derive the implied transform resource location for the update with the given bean name.The implementation in
SpringXSLUpdateTransformConfigurer
simply prepends the configured prefix and appends the configured suffix tobeanName
.- Parameters:
beanName
- schema update bean name- Returns:
- schema update resource location
-