@ManagedResource(description="Managed XsltEndpoint")
@UriEndpoint(firstVersion="1.3.0",
scheme="xslt",
title="XSLT",
syntax="xslt:resourceUri",
producerOnly=true,
label="core,transformation")
public class XsltEndpoint
extends org.apache.camel.support.ProcessorEndpoint
| Constructor and Description |
|---|
XsltEndpoint(String endpointUri,
org.apache.camel.Component component) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearCachedStylesheet() |
protected void |
configureOutput(XsltBuilder xslt,
String output) |
protected XsltBuilder |
createXsltBuilder() |
protected void |
doInit() |
protected void |
doStart() |
protected void |
doStop() |
XsltEndpoint |
findOrCreateEndpoint(String uri,
String newResourceUri) |
EntityResolver |
getEntityResolver() |
ErrorListener |
getErrorListener() |
XsltOutput |
getOutput() |
Map<String,Object> |
getParameters() |
String |
getResourceUri() |
ResultHandlerFactory |
getResultHandlerFactory() |
int |
getTransformerCacheSize() |
TransformerFactory |
getTransformerFactory() |
String |
getTransformerFactoryClass() |
TransformerFactoryConfigurationStrategy |
getTransformerFactoryConfigurationStrategy() |
URIResolver |
getUriResolver() |
XsltBuilder |
getXslt() |
boolean |
isCacheCleared() |
boolean |
isCacheStylesheet() |
boolean |
isContentCache() |
boolean |
isDeleteOutputFile() |
boolean |
isFailOnNullBody() |
protected void |
loadResource(String resourceUri,
XsltBuilder xslt)
Loads the resource.
|
protected void |
onExchange(org.apache.camel.Exchange exchange) |
void |
setCacheCleared(boolean cacheCleared) |
void |
setContentCache(boolean contentCache)
Cache for the resource content (the stylesheet file) when it is loaded.
|
void |
setDeleteOutputFile(boolean deleteOutputFile)
If you have output=file then this option dictates whether or not the output file should be deleted when the
Exchange is done processing.
|
void |
setEntityResolver(EntityResolver entityResolver)
To use a custom org.xml.sax.EntityResolver with javax.xml.transform.sax.SAXSource.
|
void |
setErrorListener(ErrorListener errorListener)
Allows to configure to use a custom javax.xml.transform.ErrorListener.
|
void |
setFailOnNullBody(boolean failOnNullBody)
Whether or not to throw an exception if the input body is null.
|
void |
setOutput(XsltOutput output)
Option to specify which output type to use.
|
void |
setParameters(Map<String,Object> parameters)
Additional parameters to configure on the javax.xml.transform.Transformer.
|
void |
setResourceUri(String resourceUri)
Path to the template.
|
void |
setResultHandlerFactory(ResultHandlerFactory resultHandlerFactory)
Allows you to use a custom org.apache.camel.builder.xml.ResultHandlerFactory which is capable of using custom
org.apache.camel.builder.xml.ResultHandler types.
|
void |
setTransformerCacheSize(int transformerCacheSize)
The number of javax.xml.transform.Transformer object that are cached for reuse to avoid calls to
Template.newTransformer().
|
void |
setTransformerFactory(TransformerFactory transformerFactory)
To use a custom XSLT transformer factory
|
void |
setTransformerFactoryClass(String transformerFactoryClass)
To use a custom XSLT transformer factory, specified as a FQN class name
|
void |
setTransformerFactoryConfigurationStrategy(TransformerFactoryConfigurationStrategy transformerFactoryConfigurationStrategy)
A configuration strategy to apply on freshly created instances of TransformerFactory.
|
void |
setUriResolver(URIResolver uriResolver)
To use a custom javax.xml.transform.URIResolver
|
void |
setXslt(XsltBuilder xslt) |
createPollingConsumer, createProcessor, createProducer, getProcessor, setProcessorconfigureConsumer, configureProperties, configureScheduledPollConsumerProperties, doConfigureConsumer, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDefaultDelay, getDelay, getInitialDelay, getPollStrategy, getRepeatCount, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, isGreedy, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRepeatCount, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelayconfigurePollingConsumer, createAsyncProducer, createEndpointUri, createExchange, createExchange, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isSingleton, isSynchronous, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toStringbuild, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic XsltEndpoint(String endpointUri, org.apache.camel.Component component)
@ManagedOperation(description="Clears the cached XSLT stylesheet, forcing to re-load the stylesheet on next request") public void clearCachedStylesheet()
@ManagedAttribute(description="Whether the XSLT stylesheet is cached") public boolean isCacheStylesheet()
public XsltEndpoint findOrCreateEndpoint(String uri, String newResourceUri)
protected void onExchange(org.apache.camel.Exchange exchange)
throws Exception
onExchange in class org.apache.camel.support.ProcessorEndpointExceptionpublic boolean isCacheCleared()
public void setCacheCleared(boolean cacheCleared)
public XsltBuilder getXslt()
public void setXslt(XsltBuilder xslt)
@ManagedAttribute(description="Path to the template") public String getResourceUri()
public void setResourceUri(String resourceUri)
resourceUri - the resource pathpublic String getTransformerFactoryClass()
public void setTransformerFactoryClass(String transformerFactoryClass)
public TransformerFactory getTransformerFactory()
public void setTransformerFactory(TransformerFactory transformerFactory)
public ResultHandlerFactory getResultHandlerFactory()
public void setResultHandlerFactory(ResultHandlerFactory resultHandlerFactory)
@ManagedAttribute(description="Whether or not to throw an exception if the input body is null") public boolean isFailOnNullBody()
public void setFailOnNullBody(boolean failOnNullBody)
@ManagedAttribute(description="What kind of option to use.") public XsltOutput getOutput()
public void setOutput(XsltOutput output)
public int getTransformerCacheSize()
public void setTransformerCacheSize(int transformerCacheSize)
public ErrorListener getErrorListener()
public void setErrorListener(ErrorListener errorListener)
@ManagedAttribute(description="Cache for the resource content (the stylesheet file) when it is loaded.") public boolean isContentCache()
public void setContentCache(boolean contentCache)
public URIResolver getUriResolver()
public void setUriResolver(URIResolver uriResolver)
public boolean isDeleteOutputFile()
public void setDeleteOutputFile(boolean deleteOutputFile)
public EntityResolver getEntityResolver()
public void setEntityResolver(EntityResolver entityResolver)
public void setParameters(Map<String,Object> parameters)
public TransformerFactoryConfigurationStrategy getTransformerFactoryConfigurationStrategy()
public void setTransformerFactoryConfigurationStrategy(TransformerFactoryConfigurationStrategy transformerFactoryConfigurationStrategy)
protected void loadResource(String resourceUri, XsltBuilder xslt) throws TransformerException, IOException
resourceUri - the resource to loadTransformerException - is thrown if error loading resourceIOException - is thrown if error loading resourceprotected void doInit()
throws Exception
doInit in class org.apache.camel.support.DefaultEndpointExceptionprotected void doStart()
throws Exception
doStart in class org.apache.camel.support.ScheduledPollEndpointExceptionprotected XsltBuilder createXsltBuilder() throws Exception
Exceptionprotected void configureOutput(XsltBuilder xslt, String output) throws Exception
ExceptionApache Camel