org.dellroad.stuff.pobj
Class SpringXSLUpdateTransformConfigurer

java.lang.Object
  extended by org.dellroad.stuff.pobj.SpringXSLUpdateTransformConfigurer
All Implemented Interfaces:
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.

See Also:
SpringXSLPersistentObjectSchemaUpdate

Field Summary
static String DEFAULT_LOCATION_PREFIX
          Default location prefix: "/".
static String DEFAULT_LOCATION_SUFFIX
          Default location suffix: ".xsl".
 
Constructor Summary
SpringXSLUpdateTransformConfigurer()
           
 
Method Summary
protected  String getImpliedTransformResourceLocation(String beanName)
          Derive the implied transform resource location for the update with the given bean name.
 Object postProcessAfterInitialization(Object bean, String beanName)
           
 Object postProcessBeforeInitialization(Object bean, String beanName)
           
 void setPrefix(String prefix)
          Set the location prefix.
 void setResourceLoader(ResourceLoader resourceLoader)
           
 void setSuffix(String suffix)
          Set the location suffix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LOCATION_PREFIX

public static final String DEFAULT_LOCATION_PREFIX
Default location prefix: "/".

See Also:
Constant Field Values

DEFAULT_LOCATION_SUFFIX

public static final String DEFAULT_LOCATION_SUFFIX
Default location suffix: ".xsl".

See Also:
Constant Field Values
Constructor Detail

SpringXSLUpdateTransformConfigurer

public SpringXSLUpdateTransformConfigurer()
Method Detail

setPrefix

public void setPrefix(String prefix)
Set the location prefix.


setSuffix

public void setSuffix(String suffix)
Set the location suffix.


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.