Package org.dellroad.stuff.pobj
Class SpringXSLPersistentObjectSchemaUpdate<T>
java.lang.Object
org.dellroad.stuff.schema.AbstractSchemaUpdate<T>
org.dellroad.stuff.spring.AbstractSpringSchemaUpdate<PersistentFileTransaction>
org.dellroad.stuff.pobj.SpringPersistentObjectSchemaUpdate<T>
org.dellroad.stuff.pobj.SpringXSLPersistentObjectSchemaUpdate<T>
- Type Parameters:
T- type of the persistent object
- All Implemented Interfaces:
DatabaseAction<PersistentFileTransaction>,SchemaUpdate<PersistentFileTransaction>,Aware,BeanFactoryAware,BeanNameAware,InitializingBean
SpringPersistentObjectSchemaUpdate that applies a configured XSL transform to the XML form of the persistent object.
The transform property is required.
See SpringPersistentObjectSchemaUpdater for a Spring XML configuration example.
-
Field Summary
Fields inherited from class org.dellroad.stuff.spring.AbstractSpringSchemaUpdate
beanFactory, beanName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConfigures the update name and required predecessors based on the Spring bean's name andBeanFactorydependencies.voidapply(PersistentFileTransaction transaction) Apply this update to the given transaction.Get the configuredTransformerFactorythat will be used to create theTransformerthat will be used to actually apply the configured XSL transform.voidsetParameters(Properties parameters) Configure XSLT parameters.voidsetTransform(Resource transform) Configure the XSLT transform as a resource.voidsetTransformerFactory(TransformerFactory transformerFactory) Set theTransformerFactoryto use.Methods inherited from class org.dellroad.stuff.pobj.SpringPersistentObjectSchemaUpdate
getDatabaseActionsMethods inherited from class org.dellroad.stuff.spring.AbstractSpringSchemaUpdate
setBeanFactory, setBeanName, setRequiredPredecessorsFromDependenciesMethods inherited from class org.dellroad.stuff.schema.AbstractSchemaUpdate
getName, getRequiredPredecessors, isSingleAction, setName, setRequiredPredecessors, setSingleAction, toString
-
Constructor Details
-
SpringXSLPersistentObjectSchemaUpdate
public SpringXSLPersistentObjectSchemaUpdate()
-
-
Method Details
-
afterPropertiesSet
Description copied from class:AbstractSpringSchemaUpdateConfigures the update name and required predecessors based on the Spring bean's name andBeanFactorydependencies.- Specified by:
afterPropertiesSetin interfaceInitializingBean- Overrides:
afterPropertiesSetin classAbstractSpringSchemaUpdate<PersistentFileTransaction>- Throws:
Exception
-
setTransform
Configure the XSLT transform as a resource.- Parameters:
transform- transform for this schema update
-
getTransform
-
setParameters
Configure XSLT parameters. This is an optional property.- Parameters:
parameters- transform parameters
-
getTransformerFactory
Get the configuredTransformerFactorythat will be used to create theTransformerthat will be used to actually apply the configured XSL transform.This property is optional; if not specified,
TransformerFactory.newInstance()is used.- Returns:
- custom factory for XSL transformers, or null if none configured
-
setTransformerFactory
Set theTransformerFactoryto use.This property is optional; if not specified,
TransformerFactory.newInstance()is used.- Parameters:
transformerFactory- custom factory for XSL transformers, or null for none- See Also:
-
apply
Apply this update to the given transaction.- Specified by:
applyin interfaceDatabaseAction<T>- Specified by:
applyin classSpringPersistentObjectSchemaUpdate<T>- Parameters:
transaction- open transaction
-