Class XsltSaxonEndpoint

java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultEndpoint
org.apache.camel.support.ScheduledPollEndpoint
org.apache.camel.support.DefaultPollingEndpoint
org.apache.camel.support.ProcessorEndpoint
org.apache.camel.component.xslt.XsltEndpoint
org.apache.camel.component.xslt.saxon.XsltSaxonEndpoint
All Implemented Interfaces:
AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.ComponentAware, org.apache.camel.Endpoint, org.apache.camel.IsSingleton, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasCamelContext, 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

    Modifier and Type
    Method
    Description
    protected org.apache.camel.component.xslt.XsltBuilder
    createBuilderForCustomStylesheet(String template, org.apache.camel.Exchange exchange)
     
     
    protected void
     
    protected void
     
    net.sf.saxon.Configuration
     
     
     
     
    boolean
     
    boolean
     
    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
    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
    void
    setSecureProcessing(boolean secureProcessing)
    Feature for XML secure processing (see javax.xml.XMLConstants).

    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, getXsltMessageLogger, isAllowTemplateFromHeader, isCacheCleared, isCacheStylesheet, isContentCache, isDeleteOutputFile, isFailOnNullBody, onExchange, setAllowTemplateFromHeader, setCacheCleared, setContentCache, setDeleteOutputFile, setEntityResolver, setErrorListener, setFailOnNullBody, setOutput, setParameters, setResourceUri, setResultHandlerFactory, setTransformerCacheSize, setTransformerFactory, setTransformerFactoryClass, setTransformerFactoryConfigurationStrategy, setUriResolver, setXslt, setXsltMessageLogger

    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

    configureExchange, configurePollingConsumer, createAsyncProducer, createEndpointUri, createExchange, createExchange, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, 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 class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.camel.ComponentAware

    getComponent

    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 Details

    • XsltSaxonEndpoint

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

    • 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.
    • isSecureProcessing

      public boolean isSecureProcessing()
    • setSecureProcessing

      public void setSecureProcessing(boolean secureProcessing)
      Feature for XML secure processing (see javax.xml.XMLConstants). This is enabled by default. However, when using Saxon Professional you may need to turn this off to allow Saxon to be able to use Java extension functions.
    • 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
    • createBuilderForCustomStylesheet

      protected org.apache.camel.component.xslt.XsltBuilder createBuilderForCustomStylesheet(String template, org.apache.camel.Exchange exchange) throws Exception
      Overrides:
      createBuilderForCustomStylesheet 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