|
Spring Web Services Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.xml.transform.TransformerHelper
public class TransformerHelper
Helper class for Transformer
usage. Provides createTransformer()
and transform(Source,
Result)
.
Constructor Summary | |
---|---|
TransformerHelper()
Initializes a new instance of the TransformerHelper . |
|
TransformerHelper(Class<? extends TransformerFactory> transformerFactoryClass)
Initializes a new instance of the TransformerHelper with the specified TransformerFactory class. |
|
TransformerHelper(TransformerFactory transformerFactory)
Initializes a new instance of the TransformerHelper with the specified TransformerFactory . |
Method Summary | |
---|---|
Transformer |
createTransformer()
Creates a new Transformer . |
TransformerFactory |
getTransformerFactory()
Returns the TransformerFactory . |
protected TransformerFactory |
newTransformerFactory(Class<? extends TransformerFactory> transformerFactoryClass)
Instantiate a new TransformerFactory. |
void |
setTransformerFactoryClass(Class<? extends TransformerFactory> transformerFactoryClass)
Specify the TransformerFactory class to use. |
void |
transform(Source source,
Result result)
Transforms the given Source to the given Result . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TransformerHelper()
TransformerHelper
.
public TransformerHelper(TransformerFactory transformerFactory)
TransformerHelper
with the specified TransformerFactory
.
public TransformerHelper(Class<? extends TransformerFactory> transformerFactoryClass)
TransformerHelper
with the specified TransformerFactory
class.
Method Detail |
---|
public void setTransformerFactoryClass(Class<? extends TransformerFactory> transformerFactoryClass)
TransformerFactory
class to use.
protected TransformerFactory newTransformerFactory(Class<? extends TransformerFactory> transformerFactoryClass)
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.
transformerFactoryClass
- the specified factory class (if any)
setTransformerFactoryClass(java.lang.Class extends javax.xml.transform.TransformerFactory>)
,
getTransformerFactory()
public TransformerFactory getTransformerFactory()
TransformerFactory
.
public Transformer createTransformer() throws TransformerConfigurationException
Transformer
. Must be called per thread, as transformers are not thread-safe.
TransformerConfigurationException
- if thrown by JAXP methodspublic void transform(Source source, Result result) throws TransformerException
Source
to the given Result
. Creates a new Transformer
for every
call, as transformers are not thread-safe.
source
- the source to transform fromresult
- the result to transform to
TransformerException
- if thrown by JAXP methods
|
Spring Web Services Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |