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
FieldsModifier and TypeFieldDescriptionprotected final org.apache.commons.logging.LogLogger available to subclasses. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final TransformerCreates a newTransformer.protected TransformerFactoryReturns theTransformerFactory.protected TransformerFactorynewTransformerFactory(Class<? extends TransformerFactory> transformerFactoryClass) Instantiate a new TransformerFactory.voidsetTransformerFactoryClass(Class<? extends TransformerFactory> transformerFactoryClass) Specify theTransformerFactoryclass 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 theTransformerFactoryclass 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 givenSourceto the givenResult. Creates a newTransformerfor 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
-