Class MustacheComponent
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultComponent
-
- org.apache.camel.component.mustache.MustacheComponent
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.Component
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@Component("mustache") public class MustacheComponent extends org.apache.camel.support.DefaultComponent
Represents the component that managesMustacheEndpoint
. URI pattern:mustache://template_name.mustache
Supports parameters:- encoding: default platform one
- startDelimiter: default "{{"
- endDelimiter: default "}}"
-
-
Constructor Summary
Constructors Constructor Description MustacheComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.camel.Endpoint
createEndpoint(String uri, String remaining, Map<String,Object> parameters)
com.github.mustachejava.MustacheFactory
getMustacheFactory()
boolean
isAllowContextMapAll()
boolean
isAllowTemplateFromHeader()
void
setAllowContextMapAll(boolean allowContextMapAll)
Sets whether the context map should allow access to all details.void
setAllowTemplateFromHeader(boolean allowTemplateFromHeader)
Whether to allow to use resource template from header or not (default false).void
setMustacheFactory(com.github.mustachejava.MustacheFactory mustacheFactory)
To use a customMustacheFactory
-
Methods inherited from class org.apache.camel.support.DefaultComponent
afterConfiguration, createEndpoint, createEndpoint, doBuild, doInit, doStart, doStop, getAndRemoveOrResolveReferenceParameter, getAndRemoveOrResolveReferenceParameter, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, getComponentPropertyConfigurer, getDefaultName, getEndpointPropertyConfigurer, getExtension, getSupportedExtensions, ifStartsWithReturnRemainder, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, registerExtension, registerExtension, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, resolveRawParameterValues, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setLazyStartProducer, setProperties, setProperties, setProperties, useIntrospectionOnEndpoint, useRawUri, validateParameters, validateURI
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, 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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
createEndpoint
protected org.apache.camel.Endpoint createEndpoint(String uri, String remaining, Map<String,Object> parameters) throws Exception
- Specified by:
createEndpoint
in classorg.apache.camel.support.DefaultComponent
- Throws:
Exception
-
getMustacheFactory
public com.github.mustachejava.MustacheFactory getMustacheFactory()
-
setMustacheFactory
public void setMustacheFactory(com.github.mustachejava.MustacheFactory mustacheFactory)
To use a customMustacheFactory
-
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.
-
isAllowContextMapAll
public boolean isAllowContextMapAll()
-
setAllowContextMapAll
public void setAllowContextMapAll(boolean allowContextMapAll)
Sets whether the context map should allow access to all details. By default only the message body and headers can be accessed. This option can be enabled for full access to the current Exchange and CamelContext. Doing so impose a potential security risk as this opens access to the full power of CamelContext API.
-
-