Class TransformerObjectSupport
java.lang.Object
org.springframework.xml.transform.TransformerObjectSupport
- Direct Known Subclasses:
AbstractAddressingEndpointMapping
,AbstractAddressingVersion
,AbstractDom4jPayloadEndpoint
,AbstractDomPayloadEndpoint
,AbstractJDomPayloadEndpoint
,AbstractLoggingInterceptor
,AbstractMethodEndpointAdapter
,AbstractPayloadMethodProcessor
,AbstractSaxPayloadEndpoint
,AbstractStaxPayloadEndpoint
,AbstractValidatingInterceptor
,AbstractValidatingInterceptor
,AbstractXomPayloadEndpoint
,AbstractXPathTemplate
,DomPoxMessageFactory
,InliningXsdSchemaTypesProvider
,LocationTransformerObjectSupport
,PayloadEndpointAdapter
,PayloadTransformingInterceptor
,StaxPayloadMethodArgumentResolver
,WebServiceAccessor
,WsdlDefinitionHttpHandler
Convenient base class for objects that use a
Transformer
. Subclasses can call createTransformer()
or
transform(Source, Result)
. This should be done per thread (i.e. per incoming request), because
Transformer
instances are not thread-safe.- Since:
- 1.0.0
- Author:
- Arjen Poutsma
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected final org.apache.commons.logging.Log
Logger available to subclasses. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final Transformer
Creates a newTransformer
.protected TransformerFactory
Returns theTransformerFactory
.protected TransformerFactory
newTransformerFactory
(Class<? extends TransformerFactory> transformerFactoryClass) Instantiate a new TransformerFactory.void
setTransformerFactoryClass
(Class<? extends TransformerFactory> transformerFactoryClass) Specify theTransformerFactory
class to use.protected final void
-
Field Details
-
logger
protected final org.apache.commons.logging.Log loggerLogger available to subclasses.
-
-
Constructor Details
-
TransformerObjectSupport
public TransformerObjectSupport()
-
-
Method Details
-
setTransformerFactoryClass
Specify theTransformerFactory
class to use. -
newTransformerFactory
protected TransformerFactory newTransformerFactory(Class<? extends TransformerFactory> transformerFactoryClass) Instantiate a new TransformerFactory.The default implementation simply calls
TransformerFactory.newInstance()
. If a"transformerFactoryClass"
has been specified explicitly, the default constructor of the specified class will be called instead.Can be overridden in subclasses.
- Parameters:
transformerFactoryClass
- the specified factory class (if any)- Returns:
- the new TransactionFactory instance
- See Also:
-
getTransformerFactory
Returns theTransformerFactory
. -
createTransformer
Creates a newTransformer
. Must be called per request, as transformers are not thread-safe.- Returns:
- the created transformer
- Throws:
TransformerConfigurationException
- if thrown by JAXP methods
-
transform
Transforms the givenSource
to the givenResult
. Creates a newTransformer
for every call, as transformers are not thread-safe.- Parameters:
source
- the source to transform fromresult
- the result to transform to- Throws:
TransformerException
- if thrown by JAXP methods
-