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 Details

    • DEFAULT_LOCATION_PREFIX

      public static final String DEFAULT_LOCATION_PREFIX
      Default location prefix: "/".
      See Also:
    • DEFAULT_LOCATION_SUFFIX

      public static final String DEFAULT_LOCATION_SUFFIX
      Default location suffix: ".xsl".
      See Also:
  • Constructor Details

    • SpringXSLUpdateTransformConfigurer

      public SpringXSLUpdateTransformConfigurer()
  • Method Details

    • setPrefix

      public void setPrefix(String prefix)
      Set the location prefix.
      Parameters:
      prefix - prefix to apply to bean names
    • setSuffix

      public void setSuffix(String suffix)
      Set the location suffix.
      Parameters:
      suffix - suffix to apply to bean names
    • setTransformerFactory

      public void setTransformerFactory(TransformerFactory transformerFactory)
      Set the TransformerFactory to configure all updates with.

      This property is optional.

      Parameters:
      transformerFactory - custom factory for XSL transformers, or null for none
    • setResourceLoader

      public void setResourceLoader(ResourceLoader resourceLoader)
      Specified by:
      setResourceLoader in interface ResourceLoaderAware
    • postProcessBeforeInitialization

      public Object postProcessBeforeInitialization(Object bean, String beanName)
      Specified by:
      postProcessBeforeInitialization in interface BeanPostProcessor
    • postProcessAfterInitialization

      public Object postProcessAfterInitialization(Object bean, String beanName)
      Specified by:
      postProcessAfterInitialization in interface BeanPostProcessor
    • getImpliedTransformResourceLocation

      protected String getImpliedTransformResourceLocation(String beanName)
      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 to beanName.

      Parameters:
      beanName - schema update bean name
      Returns:
      schema update resource location