Class XsltSaxonEndpoint

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.Endpoint, org.apache.camel.IsSingleton, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasId, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

    @ManagedResource(description="Managed XsltSaxonEndpoint")
    @UriEndpoint(firstVersion="3.0.0",
                 scheme="xslt-saxon",
                 title="XSLT Saxon",
                 syntax="xslt-saxon:resourceUri",
                 producerOnly=true,
                 category={CORE,TRANSFORMATION})
    public class XsltSaxonEndpoint
    extends org.apache.camel.component.xslt.XsltEndpoint
    Transform XML payloads using an XSLT template using Saxon.
    • Field Summary

      • Fields inherited from class org.apache.camel.support.service.BaseService

        BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
    • Constructor Summary

      Constructors 
      Constructor Description
      XsltSaxonEndpoint​(String endpointUri, org.apache.camel.Component component)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected XsltSaxonBuilder createXsltBuilder()  
      protected void doInit()  
      protected void doStart()  
      net.sf.saxon.Configuration getSaxonConfiguration()  
      Map<String,​Object> getSaxonConfigurationProperties()  
      List<Object> getSaxonExtensionFunctions()  
      Map<String,​Object> getSaxonReaderProperties()  
      boolean isAllowStAX()  
      protected void loadResource​(String resourceUri, org.apache.camel.component.xslt.XsltBuilder xslt)
      Loads the resource.
      void setAllowStAX​(boolean allowStAX)
      Whether to allow using StAX as the javax.xml.transform.Source.
      void setSaxonConfiguration​(net.sf.saxon.Configuration saxonConfiguration)
      To use a custom Saxon configuration
      void setSaxonConfigurationProperties​(Map<String,​Object> configurationProperties)
      To set custom Saxon configuration properties
      void setSaxonExtensionFunctions​(String extensionFunctions)
      Allows you to use a custom net.sf.saxon.lib.ExtensionFunctionDefinition.
      void setSaxonExtensionFunctions​(List<Object> extensionFunctions)
      Allows you to use a custom net.sf.saxon.lib.ExtensionFunctionDefinition.
      void setSaxonReaderProperties​(Map<String,​Object> saxonReaderProperties)
      To set custom Saxon Reader properties
      • Methods inherited from class org.apache.camel.component.xslt.XsltEndpoint

        clearCachedStylesheet, configureOutput, doStop, findOrCreateEndpoint, getEntityResolver, getErrorListener, getOutput, getParameters, getResourceUri, getResultHandlerFactory, getTransformerCacheSize, getTransformerFactory, getTransformerFactoryClass, getTransformerFactoryConfigurationStrategy, getUriResolver, getXslt, isCacheCleared, isCacheStylesheet, isContentCache, isDeleteOutputFile, isFailOnNullBody, onExchange, setCacheCleared, setContentCache, setDeleteOutputFile, setEntityResolver, setErrorListener, setFailOnNullBody, setOutput, setParameters, setResourceUri, setResultHandlerFactory, setTransformerCacheSize, setTransformerFactory, setTransformerFactoryClass, setTransformerFactoryConfigurationStrategy, setUriResolver, setXslt
      • Methods inherited from class org.apache.camel.support.ProcessorEndpoint

        createPollingConsumer, createProcessor, createProducer, getProcessor, setProcessor
      • Methods inherited from class org.apache.camel.support.DefaultPollingEndpoint

        createConsumer
      • Methods inherited from class org.apache.camel.support.ScheduledPollEndpoint

        configureConsumer, 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, setUseFixedDelay
      • Methods inherited from class org.apache.camel.support.DefaultEndpoint

        configurePollingConsumer, 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, toString
      • Methods inherited from class org.apache.camel.support.service.BaseService

        build, 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, suspend
      • Methods inherited from interface org.apache.camel.Endpoint

        getEndpointBaseUri, isSingletonProducer
      • Methods inherited from interface org.apache.camel.Service

        build, close, init, start, stop
      • Methods inherited from interface org.apache.camel.ShutdownableService

        shutdown
      • Methods inherited from interface org.apache.camel.StatefulService

        getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
      • Methods inherited from interface org.apache.camel.SuspendableService

        isSuspended, resume, suspend
    • Constructor Detail

      • XsltSaxonEndpoint

        public XsltSaxonEndpoint​(String endpointUri,
                                 org.apache.camel.Component component)
    • Method Detail

      • getSaxonExtensionFunctions

        public List<Object> getSaxonExtensionFunctions()
      • setSaxonExtensionFunctions

        public void setSaxonExtensionFunctions​(List<Object> extensionFunctions)
        Allows you to use a custom net.sf.saxon.lib.ExtensionFunctionDefinition. You would need to add camel-saxon to the classpath. The function is looked up in the registry, where you can comma to separate multiple values to lookup.
      • setSaxonExtensionFunctions

        public void setSaxonExtensionFunctions​(String extensionFunctions)
        Allows you to use a custom net.sf.saxon.lib.ExtensionFunctionDefinition. You would need to add camel-saxon to the classpath. The function is looked up in the registry, where you can comma to separate multiple values to lookup.
      • getSaxonConfiguration

        public net.sf.saxon.Configuration getSaxonConfiguration()
      • setSaxonConfiguration

        public void setSaxonConfiguration​(net.sf.saxon.Configuration saxonConfiguration)
        To use a custom Saxon configuration
      • getSaxonConfigurationProperties

        public Map<String,​Object> getSaxonConfigurationProperties()
      • setSaxonConfigurationProperties

        public void setSaxonConfigurationProperties​(Map<String,​Object> configurationProperties)
        To set custom Saxon configuration properties
      • getSaxonReaderProperties

        public Map<String,​Object> getSaxonReaderProperties()
      • setSaxonReaderProperties

        public void setSaxonReaderProperties​(Map<String,​Object> saxonReaderProperties)
        To set custom Saxon Reader properties
      • isAllowStAX

        @ManagedAttribute(description="Whether to allow using StAX as the javax.xml.transform.Source")
        public boolean isAllowStAX()
      • setAllowStAX

        public void setAllowStAX​(boolean allowStAX)
        Whether to allow using StAX as the javax.xml.transform.Source. You can enable this if the XSLT library supports StAX such as the Saxon library (camel-saxon). The Xalan library (default in JVM) does not support StAXSource.
      • doInit

        protected void doInit()
                       throws Exception
        Overrides:
        doInit in class org.apache.camel.component.xslt.XsltEndpoint
        Throws:
        Exception
      • doStart

        protected void doStart()
                        throws Exception
        Overrides:
        doStart in class org.apache.camel.component.xslt.XsltEndpoint
        Throws:
        Exception
      • createXsltBuilder

        protected XsltSaxonBuilder createXsltBuilder()
                                              throws Exception
        Overrides:
        createXsltBuilder in class org.apache.camel.component.xslt.XsltEndpoint
        Throws:
        Exception
      • loadResource

        protected void loadResource​(String resourceUri,
                                    org.apache.camel.component.xslt.XsltBuilder xslt)
                             throws TransformerException,
                                    IOException
        Loads the resource.
        Overrides:
        loadResource in class org.apache.camel.component.xslt.XsltEndpoint
        Parameters:
        resourceUri - the resource to load
        Throws:
        TransformerException - is thrown if error loading resource
        IOException - is thrown if error loading resource