Class MustacheEndpoint
- 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.ResourceEndpoint
-
- org.apache.camel.component.mustache.MustacheEndpoint
-
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.api.management.mbean.ManagedResourceEndpointMBean,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
@UriEndpoint(firstVersion="2.12.0", scheme="mustache", title="Mustache", syntax="mustache:resourceUri", producerOnly=true, category=TRANSFORMATION) public class MustacheEndpoint extends org.apache.camel.component.ResourceEndpointTransform messages using a Mustache template.
-
-
Constructor Summary
Constructors Constructor Description MustacheEndpoint()MustacheEndpoint(String endpointUri, org.apache.camel.Component component, String resourceUri)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearContentCache()protected StringcreateEndpointUri()StringgetEncoding()StringgetEndDelimiter()org.apache.camel.ExchangePatterngetExchangePattern()com.github.mustachejava.MustacheFactorygetMustacheFactory()StringgetResourceUri()StringgetStartDelimiter()booleanisAllowTemplateFromHeader()protected voidonExchange(org.apache.camel.Exchange exchange)voidsetAllowTemplateFromHeader(boolean allowTemplateFromHeader)Whether to allow to use resource template from header or not (default false).voidsetEncoding(String encoding)Character encoding of the resource content.voidsetEndDelimiter(String endDelimiter)Characters used to mark template code end.voidsetMustacheFactory(com.github.mustachejava.MustacheFactory mustacheFactory)To use a customMustacheFactoryvoidsetStartDelimiter(String startDelimiter)Characters used to mark template code beginning.-
Methods inherited from class org.apache.camel.component.ResourceEndpoint
getCamelId, getCamelManagementName, getResourceAsInputStream, getResourceAsInputStreamWithoutCache, getState, isAllowContextMapAll, isContentCache, isContentCacheCleared, loadResource, setAllowContextMapAll, setContentCache, setResourceUri
-
Methods inherited from class org.apache.camel.support.ProcessorEndpoint
createPollingConsumer, createProcessor, createProducer, getProcessor, setProcessor
-
Methods inherited from class org.apache.camel.support.ScheduledPollEndpoint
configureConsumer, configureProperties, configureScheduledPollConsumerProperties, doConfigureConsumer, doStart, doStop, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, 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, createExchange, createExchange, doInit, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isBasicPropertyBinding, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isSingleton, isSynchronous, setBasicPropertyBinding, 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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
getExchangePattern
public org.apache.camel.ExchangePattern getExchangePattern()
- Overrides:
getExchangePatternin classorg.apache.camel.support.DefaultEndpoint
-
createEndpointUri
protected String createEndpointUri()
- Overrides:
createEndpointUriin classorg.apache.camel.support.DefaultEndpoint
-
clearContentCache
public void clearContentCache()
- Specified by:
clearContentCachein interfaceorg.apache.camel.api.management.mbean.ManagedResourceEndpointMBean- Overrides:
clearContentCachein classorg.apache.camel.component.ResourceEndpoint
-
onExchange
protected void onExchange(org.apache.camel.Exchange exchange) throws Exception- Overrides:
onExchangein classorg.apache.camel.support.ProcessorEndpoint- Throws:
Exception
-
getResourceUri
public String getResourceUri()
- Overrides:
getResourceUriin classorg.apache.camel.component.ResourceEndpoint
-
getMustacheFactory
public com.github.mustachejava.MustacheFactory getMustacheFactory()
-
setMustacheFactory
public void setMustacheFactory(com.github.mustachejava.MustacheFactory mustacheFactory)
To use a customMustacheFactory
-
getEncoding
public String getEncoding()
-
setEncoding
public void setEncoding(String encoding)
Character encoding of the resource content.
-
getStartDelimiter
public String getStartDelimiter()
-
setStartDelimiter
public void setStartDelimiter(String startDelimiter)
Characters used to mark template code beginning.
-
getEndDelimiter
public String getEndDelimiter()
-
setEndDelimiter
public void setEndDelimiter(String endDelimiter)
Characters used to mark template code end.
-
isAllowTemplateFromHeader
public boolean isAllowTemplateFromHeader()
-
setAllowTemplateFromHeader
public void setAllowTemplateFromHeader(boolean allowTemplateFromHeader)
Whether to allow to use resource template from header or not (default false). Enabling this allows to specify dynamic templates via message header. However this can be seen as a potential security vulnerability if the header is coming from a malicious user, so use this with care.
-
-