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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Configures the update name and required predecessors based on the Spring bean's name andBeanFactory
dependencies.void
apply
(PersistentFileTransaction transaction) Apply this update to the given transaction.Get the configuredTransformerFactory
that will be used to create theTransformer
that will be used to actually apply the configured XSL transform.void
setParameters
(Properties parameters) Configure XSLT parameters.void
setTransform
(Resource transform) Configure the XSLT transform as a resource.void
setTransformerFactory
(TransformerFactory transformerFactory) Set theTransformerFactory
to use.Methods inherited from class org.dellroad.stuff.pobj.SpringPersistentObjectSchemaUpdate
getDatabaseActions
Methods inherited from class org.dellroad.stuff.spring.AbstractSpringSchemaUpdate
setBeanFactory, setBeanName, setRequiredPredecessorsFromDependencies
Methods 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:AbstractSpringSchemaUpdate
Configures the update name and required predecessors based on the Spring bean's name andBeanFactory
dependencies.- Specified by:
afterPropertiesSet
in interfaceInitializingBean
- Overrides:
afterPropertiesSet
in 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 configuredTransformerFactory
that will be used to create theTransformer
that 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 theTransformerFactory
to 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:
apply
in interfaceDatabaseAction<T>
- Specified by:
apply
in classSpringPersistentObjectSchemaUpdate<T>
- Parameters:
transaction
- open transaction
-