Package org.apache.camel.component.xslt
Class XsltBuilder
java.lang.Object
org.apache.camel.component.xslt.XsltBuilder
- All Implemented Interfaces:
org.apache.camel.Processor
Creates a Processor which performs an XSLT transformation of the
IN message body.
Will by default output the result as a String. You can chose which kind of output you want using the
outputXXX methods.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddParameters(Transformer transformer, Map<String, Object> map) protected voidconfigureTransformer(Transformer transformer, org.apache.camel.Exchange exchange) Configures the transformer with exchange specific parametersprotected Transformerprotected XmlSourceHandlerFactoryImplShould the output file be deleted when theExchangeis done.errorListener(ErrorListener errorListener) Uses a customErrorListener.booleanbooleanSets the output as being a byte[]Sets the output as being a DOMSets the output as being a File where the filename must be provided in theExchange.XSLT_FILE_NAMEheader.Sets the output as being a Stringprotected SourceprepareSource(Source source) Allows to prepare the source before transforming.voidprocess(org.apache.camel.Exchange exchange) voidsetDeleteOutputFile(boolean deleteOutputFile) voidsetEntityResolver(EntityResolver entityResolver) voidsetErrorListener(ErrorListener errorListener) voidsetFailOnNullBody(boolean failOnNullBody) voidsetParameters(Map<String, Object> parameters) voidsetResultHandlerFactory(ResultHandlerFactory resultHandlerFactory) voidsetSourceHandlerFactory(SourceHandlerFactory sourceHandlerFactory) voidsetTemplate(Templates template) voidsetTransformerFactory(TransformerFactory transformerFactory) voidsetTransformerFile(File xslt) Sets the XSLT transformer from a FilevoidSets the XSLT transformer from the given input streamvoidsetTransformerSource(Source source) Sets the XSLT transformer from a SourcevoidsetTransformerURL(URL url) Sets the XSLT transformer from a URLvoidsetUriResolver(URIResolver uriResolver) toString()transformerCacheSize(int numberToCache) Used for cachingTransformers.uriResolver(URIResolver uriResolver) Sets a custom URI resolver to be usedstatic XsltBuilderCreates an XSLT processor using the given XSLT sourcestatic XsltBuilderxslt(InputStream xslt) Creates an XSLT processor using the given XSLT sourcestatic XsltBuilderCreates an XSLT processor using the given XSLT sourcestatic XsltBuilderCreates an XSLT processor using the given XSLT sourcestatic XsltBuilderCreates an XSLT processor using the given templates instance
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG
-
-
Constructor Details
-
XsltBuilder
public XsltBuilder() -
XsltBuilder
-
-
Method Details
-
toString
-
process
- Specified by:
processin interfaceorg.apache.camel.Processor- Throws:
Exception
-
prepareSource
Allows to prepare the source before transforming. -
xslt
Creates an XSLT processor using the given templates instance -
xslt
Creates an XSLT processor using the given XSLT source -
xslt
Creates an XSLT processor using the given XSLT source -
xslt
Creates an XSLT processor using the given XSLT source -
xslt
Creates an XSLT processor using the given XSLT source -
outputBytes
Sets the output as being a byte[] -
outputString
Sets the output as being a String -
outputDOM
Sets the output as being a DOM -
outputFile
Sets the output as being a File where the filename must be provided in theExchange.XSLT_FILE_NAMEheader. -
deleteOutputFile
Should the output file be deleted when theExchangeis done. This option should only be used if you useoutputFile()as well. -
parameter
-
uriResolver
Sets a custom URI resolver to be used -
transformerCacheSize
Used for cachingTransformers. By default no caching is in use.- Parameters:
numberToCache- the maximum number of transformers to cache
-
errorListener
Uses a customErrorListener. -
getParameters
-
setParameters
-
setTemplate
-
getTemplate
-
isFailOnNullBody
public boolean isFailOnNullBody() -
setFailOnNullBody
public void setFailOnNullBody(boolean failOnNullBody) -
getSourceHandlerFactory
-
createXmlSourceHandlerFactoryImpl
-
setSourceHandlerFactory
-
getResultHandlerFactory
-
setResultHandlerFactory
-
setTransformerSource
Sets the XSLT transformer from a Source- Parameters:
source- the source- Throws:
TransformerConfigurationException- is thrown if creating a XSLT transformer failed.
-
setTransformerFile
Sets the XSLT transformer from a File -
setTransformerURL
Sets the XSLT transformer from a URL -
setTransformerInputStream
Sets the XSLT transformer from the given input stream -
getUriResolver
-
setUriResolver
-
setEntityResolver
-
isDeleteOutputFile
public boolean isDeleteOutputFile() -
setDeleteOutputFile
public void setDeleteOutputFile(boolean deleteOutputFile) -
getErrorListener
-
setErrorListener
-
setTransformerFactory
-
createTransformer
- Throws:
Exception
-
configureTransformer
protected void configureTransformer(Transformer transformer, org.apache.camel.Exchange exchange) throws Exception Configures the transformer with exchange specific parameters- Throws:
Exception
-
addParameters
-