@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 ProcessorEndpoint
Modifier and Type | Field and Description |
---|---|
static String |
SAXON_TRANSFORMER_FACTORY_CLASS_NAME |
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
XsltEndpoint(String endpointUri,
Component component) |
XsltEndpoint(String endpointUri,
Component component,
XsltBuilder xslt,
String resourceUri,
boolean cacheStylesheet)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCachedStylesheet() |
protected void |
configureOutput(XsltBuilder xslt,
String output) |
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
protected void |
doStop()
Implementations override this method to support customized start/stop.
|
XsltEndpoint |
findOrCreateEndpoint(String uri,
String newResourceUri) |
XmlConverter |
getConverter() |
EntityResolver |
getEntityResolver() |
ErrorListener |
getErrorListener() |
XsltOutput |
getOutput() |
Map<String,Object> |
getParameters() |
String |
getResourceUri() |
ResultHandlerFactory |
getResultHandlerFactory() |
Object |
getSaxonConfiguration() |
Map<String,Object> |
getSaxonConfigurationProperties() |
List<Object> |
getSaxonExtensionFunctions() |
int |
getTransformerCacheSize() |
TransformerFactory |
getTransformerFactory() |
String |
getTransformerFactoryClass() |
URIResolver |
getUriResolver() |
XsltBuilder |
getXslt() |
boolean |
isAllowStAX() |
boolean |
isCacheCleared() |
boolean |
isCacheStylesheet() |
boolean |
isContentCache() |
boolean |
isDeleteOutputFile() |
boolean |
isFailOnNullBody() |
boolean |
isSaxon() |
protected void |
loadResource(String resourceUri)
Loads the resource.
|
protected void |
onExchange(Exchange exchange) |
void |
setAllowStAX(boolean allowStAX)
Whether to allow using StAX as the javax.xml.transform.Source.
|
void |
setCacheCleared(boolean cacheCleared) |
void |
setContentCache(boolean contentCache)
Cache for the resource content (the stylesheet file) when it is loaded.
|
void |
setConverter(XmlConverter converter)
To use a custom implementation of
XmlConverter |
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 |
setSaxon(boolean saxon)
Whether to use Saxon as the transformerFactoryClass.
|
void |
setSaxonConfiguration(Object saxonConfiguration)
To use a custom Saxon configuration
|
void |
setSaxonConfigurationProperties(Map<String,Object> configurationProperties)
To set custom Saxon configuration properties
|
void |
setSaxonExtensionFunctions(List<Object> extensionFunctions)
Allows you to use a custom net.sf.saxon.lib.ExtensionFunctionDefinition.
|
void |
setSaxonExtensionFunctions(String extensionFunctions)
Allows you to use a custom net.sf.saxon.lib.ExtensionFunctionDefinition.
|
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 |
setUriResolver(URIResolver uriResolver)
To use a custom javax.xml.transform.URIResolver
|
void |
setXslt(XsltBuilder xslt) |
createPollingConsumer, createProcessor, createProducer, getProcessor, isSingleton, setProcessor
createConsumer
configurePollingConsumer, configureProperties, configureScheduledPollConsumerProperties, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDelay, getInitialDelay, getPollStrategy, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, initConsumerProperties, isGreedy, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelay
configureConsumer, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, equals, getCamelContext, getComponent, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isBridgeErrorHandler, isLenientProperties, isPollingConsumerBlockWhenFull, isSynchronous, setBridgeErrorHandler, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toString
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public static final String SAXON_TRANSFORMER_FACTORY_CLASS_NAME
@Deprecated public XsltEndpoint(String endpointUri, Component component, XsltBuilder xslt, String resourceUri, boolean cacheStylesheet) throws Exception
Exception
public XsltEndpoint(String endpointUri, 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(Exchange exchange) throws Exception
onExchange
in class ProcessorEndpoint
Exception
public 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 XmlConverter getConverter()
public void setConverter(XmlConverter converter)
XmlConverter
public String getTransformerFactoryClass()
public void setTransformerFactoryClass(String transformerFactoryClass)
public TransformerFactory getTransformerFactory()
public void setTransformerFactory(TransformerFactory transformerFactory)
@ManagedAttribute(description="Whether to use Saxon as the transformerFactoryClass") public boolean isSaxon()
public void setSaxon(boolean saxon)
public List<Object> getSaxonExtensionFunctions()
public void setSaxonExtensionFunctions(List<Object> extensionFunctions)
public void setSaxonExtensionFunctions(String extensionFunctions)
public Object getSaxonConfiguration()
public void setSaxonConfiguration(Object saxonConfiguration)
public Map<String,Object> getSaxonConfigurationProperties()
public void setSaxonConfigurationProperties(Map<String,Object> configurationProperties)
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)
@ManagedAttribute(description="Whether to allow using StAX as the javax.xml.transform.Source") public boolean isAllowStAX()
public void setAllowStAX(boolean allowStAX)
public boolean isDeleteOutputFile()
public void setDeleteOutputFile(boolean deleteOutputFile)
public EntityResolver getEntityResolver()
public void setEntityResolver(EntityResolver entityResolver)
public Map<String,Object> getParameters()
public void setParameters(Map<String,Object> parameters)
protected void loadResource(String resourceUri) throws TransformerException, IOException
resourceUri
- the resource to loadTransformerException
- is thrown if error loading resourceIOException
- is thrown if error loading resourceprotected void doStart() throws Exception
ServiceSupport
ServiceSupport.doStop()
for more details.doStart
in class ScheduledPollEndpoint
Exception
ServiceSupport.doStop()
protected void configureOutput(XsltBuilder xslt, String output) throws Exception
Exception
protected void doStop() throws Exception
ServiceSupport
ServiceSupport.doStop()
method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext
is shutting down.doStop
in class ScheduledPollEndpoint
Exception
ServiceSupport.doStart()
Apache Camel