Package org.apache.camel.builder
Class BuilderSupport
java.lang.Object
org.apache.camel.builder.BuilderSupport
- All Implemented Interfaces:
org.apache.camel.CamelContextAware
- Direct Known Subclasses:
RouteBuilder
Base class for implementation inheritance for different clauses in the
Java DSL
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
BuilderSupport
(org.apache.camel.CamelContext context) -
Method Summary
Modifier and TypeMethodDescriptionbody()
Returns a predicate and value builder for the inbound body on an exchange<T> ValueBuilder
Returns a predicate and value builder for the inbound message body as a specific typeReturns a constant expression value builderReturns a constant expression value builderReturns a constant expression value builderprotected org.apache.camel.ErrorHandlerFactory
Returns a compiled simple expression value builderReturns a compiled simple expression value builderdatasonnet
(String value) Returns a datasonnet expression value builderdatasonnet
(String value, Class<?> resultType) Returns a datasonnet expression value builderdatasonnet
(String value, Class<?> resultType, String bodyMediaType, String outputMediaType) Returns a datasonnet expression value builderdeadLetterChannel
(String deadLetterUri) Dead Letter Channel EIP: is a error handler for handling messages that could not be delivered to it's intended destination.deadLetterChannel
(org.apache.camel.Endpoint deadLetterEndpoint) Dead Letter Channel EIP: is a error handler for handling messages that could not be delivered to it's intended destination.Creates a default error handler.org.apache.camel.Endpoint
Deprecated.<T extends org.apache.camel.Endpoint>
TDeprecated.useCamelContext.getEndpoint(String, Class)
insteadList<org.apache.camel.Endpoint>
Deprecated.useCamelContext.getEndpoint(String)
insteadList<org.apache.camel.Endpoint>
endpoints
(org.apache.camel.Endpoint... endpoints) Deprecated.Returns a exception expression value builderexchangeProperty
(String name) Returns a value builder for the given exchange propertyexpression
(org.apache.camel.Expression exp) Returns a value builder for the given expressionorg.apache.camel.CamelContext
org.apache.camel.CamelContext
Get theCamelContext
org.apache.camel.ErrorHandlerFactory
boolean
Returns a value builder for the given headerReturns a JOOR expression value builderReturns a JOOR expression value builderReturns a JSonPath expression value builderReturns a JSonPath expression value builderError handler using JTA transactions (requires camel-jta).jtaTransactionErrorHandler
(String policyRef) Error handler using JTA transactions (requires camel-jta).jtaTransactionErrorHandler
(org.apache.camel.spi.TransactedPolicy policy) Error handler using JTA transactions (requires camel-jta).Returns a method call expression value builderReturns a method call expression value builderReturns a method call expression value builderReturns a method call expression value builderCreates a disabled error handler for removing the default error handlerregexReplaceAll
(org.apache.camel.Expression content, String regex, String replacement) Returns an expression value builder that replaces all occurrences of the regular expression with the given replacementregexReplaceAll
(org.apache.camel.Expression content, String regex, org.apache.camel.Expression replacement) Returns an expression value builder that replaces all occurrences of the regular expression with the given replacementvoid
setCamelContext
(org.apache.camel.CamelContext camelContext) void
setErrorHandlerFactory
(org.apache.camel.ErrorHandlerFactory errorHandlerFactory) Sets the error handler to use with processors created by this builderReturns a simple expression value builderReturns a simple expression value builderReturns a simple expression value builder, using String.format styleReturns a simple expression value builder, using String.format styleError handler using Spring transactions (requires camel-spring).springTransactionErrorHandler
(String policyRef) Error handler using Spring transactions (requires camel-spring).springTransactionErrorHandler
(org.apache.camel.spi.TransactedPolicy policy) Error handler using Spring transactions (requires camel-spring).systemProperty
(String name) Returns a value builder for the given system propertysystemProperty
(String name, String defaultValue) Returns a value builder for the given system propertyReturns a xpath expression value builderReturns a xpath expression value builderReturns a xpath expression value builderReturns a xpath expression value builder
-
Constructor Details
-
BuilderSupport
protected BuilderSupport() -
BuilderSupport
protected BuilderSupport(org.apache.camel.CamelContext context)
-
-
Method Details
-
expression
Returns a value builder for the given expression -
header
Returns a value builder for the given header -
exchangeProperty
Returns a value builder for the given exchange property -
body
Returns a predicate and value builder for the inbound body on an exchange -
bodyAs
Returns a predicate and value builder for the inbound message body as a specific type -
systemProperty
Returns a value builder for the given system property -
systemProperty
Returns a value builder for the given system property -
constant
Returns a constant expression value builder -
constant
Returns a constant expression value builder -
constant
Returns a constant expression value builder -
joor
Returns a JOOR expression value builder -
joor
Returns a JOOR expression value builder -
jsonpath
Returns a JSonPath expression value builder -
jsonpath
Returns a JSonPath expression value builder- Parameters:
value
- The JSonPath expressionresultType
- The result type that the JSonPath expression will return.
-
csimple
Returns a compiled simple expression value builder -
csimple
Returns a compiled simple expression value builder -
datasonnet
Returns a datasonnet expression value builder -
datasonnet
Returns a datasonnet expression value builder -
datasonnet
public ValueBuilder datasonnet(String value, Class<?> resultType, String bodyMediaType, String outputMediaType) Returns a datasonnet expression value builder -
simple
Returns a simple expression value builder -
simple
Returns a simple expression value builder -
simpleF
Returns a simple expression value builder, using String.format style -
simpleF
Returns a simple expression value builder, using String.format style -
xpath
Returns a xpath expression value builder- Parameters:
value
- the XPath expression- Returns:
- the builder
-
xpath
Returns a xpath expression value builder- Parameters:
value
- the XPath expressionresultType
- the result type that the XPath expression will return.- Returns:
- the builder
-
xpath
Returns a xpath expression value builder- Parameters:
value
- the XPath expressionnamespaces
- namespace mappings- Returns:
- the builder
-
xpath
public ValueBuilder xpath(String value, Class<?> resultType, org.apache.camel.support.builder.Namespaces namespaces) Returns a xpath expression value builder- Parameters:
value
- the XPath expressionresultType
- the result type that the XPath expression will return.namespaces
- namespace mappings- Returns:
- the builder
-
method
Returns a method call expression value builder This method accepts dual parameters. Either an bean instance or a reference to a bean (String).- Parameters:
beanOrBeanRef
- either an instanceof a bean or a reference to bean to lookup in the Registry- Returns:
- the builder
-
method
Returns a method call expression value builder This method accepts dual parameters. Either an bean instance or a reference to a bean (String).- Parameters:
beanOrBeanRef
- either an instanceof a bean or a reference to bean to lookup in the Registrymethod
- name of method to invoke- Returns:
- the builder
-
method
Returns a method call expression value builder- Parameters:
beanType
- the Class of the bean which we want to invoke- Returns:
- the builder
-
method
Returns a method call expression value builder- Parameters:
beanType
- the Class of the bean which we want to invokemethod
- name of method to invoke- Returns:
- the builder
-
regexReplaceAll
public ValueBuilder regexReplaceAll(org.apache.camel.Expression content, String regex, String replacement) Returns an expression value builder that replaces all occurrences of the regular expression with the given replacement -
regexReplaceAll
public ValueBuilder regexReplaceAll(org.apache.camel.Expression content, String regex, org.apache.camel.Expression replacement) Returns an expression value builder that replaces all occurrences of the regular expression with the given replacement -
exceptionMessage
Returns a exception expression value builder -
endpoint
@Deprecated public org.apache.camel.Endpoint endpoint(String uri) throws org.apache.camel.NoSuchEndpointException Deprecated.useCamelContext.getEndpoint(String)
insteadResolves the given URI to an endpoint- Parameters:
uri
- the uri to resolve- Returns:
- the endpoint
- Throws:
org.apache.camel.NoSuchEndpointException
- if the endpoint URI could not be resolved
-
endpoint
@Deprecated public <T extends org.apache.camel.Endpoint> T endpoint(String uri, Class<T> type) throws org.apache.camel.NoSuchEndpointException Deprecated.useCamelContext.getEndpoint(String, Class)
insteadResolves the given URI to an endpoint of the specified type- Parameters:
uri
- the uri to resolvetype
- the excepted type of the endpoint- Returns:
- the endpoint
- Throws:
org.apache.camel.NoSuchEndpointException
- if the endpoint URI could not be resolved
-
endpoints
@Deprecated public List<org.apache.camel.Endpoint> endpoints(String... uris) throws org.apache.camel.NoSuchEndpointException Deprecated.useCamelContext.getEndpoint(String)
insteadResolves the list of URIs into a list ofEndpoint
instances- Parameters:
uris
- list of endpoints to resolve- Returns:
- list of endpoints
- Throws:
org.apache.camel.NoSuchEndpointException
- if an endpoint URI could not be resolved
-
endpoints
@Deprecated public List<org.apache.camel.Endpoint> endpoints(org.apache.camel.Endpoint... endpoints) Deprecated.Helper method to create a list ofEndpoint
instances- Parameters:
endpoints
- endpoints- Returns:
- list of the given endpoints
-
defaultErrorHandler
Creates a default error handler.- Returns:
- the builder
-
noErrorHandler
Creates a disabled error handler for removing the default error handler- Returns:
- the builder
-
deadLetterChannel
Dead Letter Channel EIP: is a error handler for handling messages that could not be delivered to it's intended destination.- Parameters:
deadLetterUri
- uri to the dead letter endpoint storing dead messages- Returns:
- the builder
-
deadLetterChannel
Dead Letter Channel EIP: is a error handler for handling messages that could not be delivered to it's intended destination.- Parameters:
deadLetterEndpoint
- dead letter endpoint storing dead messages- Returns:
- the builder
-
jtaTransactionErrorHandler
Error handler using JTA transactions (requires camel-jta).- Returns:
- the builder
-
jtaTransactionErrorHandler
public JtaTransactionErrorHandlerBuilder jtaTransactionErrorHandler(org.apache.camel.spi.TransactedPolicy policy) Error handler using JTA transactions (requires camel-jta).- Parameters:
policy
- the transaction policy- Returns:
- the builder
-
jtaTransactionErrorHandler
Error handler using JTA transactions (requires camel-jta).- Parameters:
policyRef
- references to the transaction policy- Returns:
- the builder
-
springTransactionErrorHandler
Error handler using Spring transactions (requires camel-spring).- Returns:
- the builder
-
springTransactionErrorHandler
public SpringTransactionErrorHandlerBuilder springTransactionErrorHandler(org.apache.camel.spi.TransactedPolicy policy) Error handler using Spring transactions (requires camel-spring).- Parameters:
policy
- the transaction policy- Returns:
- the builder
-
springTransactionErrorHandler
Error handler using Spring transactions (requires camel-spring).- Parameters:
policyRef
- references to the transaction policy- Returns:
- the builder
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()- Specified by:
getCamelContext
in interfaceorg.apache.camel.CamelContextAware
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext) - Specified by:
setCamelContext
in interfaceorg.apache.camel.CamelContextAware
-
getContext
public org.apache.camel.CamelContext getContext()Get theCamelContext
- Returns:
- camelContext the Camel context
-
getErrorHandlerFactory
public org.apache.camel.ErrorHandlerFactory getErrorHandlerFactory() -
createErrorHandlerBuilder
protected org.apache.camel.ErrorHandlerFactory createErrorHandlerBuilder() -
setErrorHandlerFactory
public void setErrorHandlerFactory(org.apache.camel.ErrorHandlerFactory errorHandlerFactory) Sets the error handler to use with processors created by this builder -
hasErrorHandlerFactory
public boolean hasErrorHandlerFactory()- Returns:
- true if an error handler factory was initialized
-
CamelContext.getEndpoint(String)
instead