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
public abstract class BuilderSupport extends Object implements org.apache.camel.CamelContextAware
Base class for implementation inheritance for different clauses in the Java DSL
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BuilderSupport()
protected
BuilderSupport(org.apache.camel.CamelContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ValueBuilder
body()
Returns a predicate and value builder for the inbound body on an exchange<T> ValueBuilder
bodyAs(Class<T> type)
Returns a predicate and value builder for the inbound message body as a specific typeValueBuilder
constant(Object value)
Returns a constant expression value builderValueBuilder
constant(Object... value)
Returns a constant expression value builderValueBuilder
constant(Object value, boolean trim)
Returns a constant expression value builderprotected org.apache.camel.ErrorHandlerFactory
createErrorHandlerBuilder()
ValueBuilder
csimple(String value)
Returns a compiled simple expression value builderValueBuilder
csimple(String value, Class<?> resultType)
Returns a compiled simple expression value builderValueBuilder
datasonnet(String value)
Returns a datasonnet expression value builderValueBuilder
datasonnet(String value, Class<?> resultType)
Returns a datasonnet expression value builderValueBuilder
datasonnet(String value, Class<?> resultType, String bodyMediaType, String outputMediaType)
Returns a datasonnet expression value builderDeadLetterChannelBuilder
deadLetterChannel(String deadLetterUri)
Dead Letter Channel EIP: is a error handler for handling messages that could not be delivered to it's intended destination.DeadLetterChannelBuilder
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.DefaultErrorHandlerBuilder
defaultErrorHandler()
Creates a default error handler.org.apache.camel.Endpoint
endpoint(String uri)
Deprecated.useCamelContext.getEndpoint(String)
instead<T extends org.apache.camel.Endpoint>
Tendpoint(String uri, Class<T> type)
Deprecated.useCamelContext.getEndpoint(String, Class)
insteadList<org.apache.camel.Endpoint>
endpoints(String... uris)
Deprecated.useCamelContext.getEndpoint(String)
insteadList<org.apache.camel.Endpoint>
endpoints(org.apache.camel.Endpoint... endpoints)
Deprecated.ValueBuilder
exceptionMessage()
Returns a exception expression value builderValueBuilder
exchangeProperty(String name)
Returns a value builder for the given exchange propertyValueBuilder
expression(org.apache.camel.Expression exp)
Returns a value builder for the given expressionorg.apache.camel.CamelContext
getCamelContext()
org.apache.camel.CamelContext
getContext()
Get theCamelContext
org.apache.camel.ErrorHandlerFactory
getErrorHandlerFactory()
boolean
hasErrorHandlerFactory()
ValueBuilder
header(String name)
Returns a value builder for the given headerValueBuilder
joor(String value)
Returns a JOOR expression value builderValueBuilder
joor(String value, Class<?> resultType)
Returns a JOOR expression value builderValueBuilder
jsonpath(String value)
Returns a JSonPath expression value builderValueBuilder
jsonpath(String value, Class<?> resultType)
Returns a JSonPath expression value builderJtaTransactionErrorHandlerBuilder
jtaTransactionErrorHandler()
Error handler using JTA transactions (requires camel-jta).JtaTransactionErrorHandlerBuilder
jtaTransactionErrorHandler(String policyRef)
Error handler using JTA transactions (requires camel-jta).JtaTransactionErrorHandlerBuilder
jtaTransactionErrorHandler(org.apache.camel.spi.TransactedPolicy policy)
Error handler using JTA transactions (requires camel-jta).ValueBuilder
method(Class<?> beanType)
Returns a method call expression value builderValueBuilder
method(Class<?> beanType, String method)
Returns a method call expression value builderValueBuilder
method(Object beanOrBeanRef)
Returns a method call expression value builderValueBuilder
method(Object beanOrBeanRef, String method)
Returns a method call expression value builderNoErrorHandlerBuilder
noErrorHandler()
Creates a disabled error handler for removing the default error handlerValueBuilder
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 replacementValueBuilder
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 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 builderValueBuilder
simple(String value)
Returns a simple expression value builderValueBuilder
simple(String value, Class<?> resultType)
Returns a simple expression value builderValueBuilder
simpleF(String format, Class<?> resultType, Object... values)
Returns a simple expression value builder, using String.format styleValueBuilder
simpleF(String format, Object... values)
Returns a simple expression value builder, using String.format styleSpringTransactionErrorHandlerBuilder
springTransactionErrorHandler()
Error handler using Spring transactions (requires camel-spring).SpringTransactionErrorHandlerBuilder
springTransactionErrorHandler(String policyRef)
Error handler using Spring transactions (requires camel-spring).SpringTransactionErrorHandlerBuilder
springTransactionErrorHandler(org.apache.camel.spi.TransactedPolicy policy)
Error handler using Spring transactions (requires camel-spring).ValueBuilder
systemProperty(String name)
Returns a value builder for the given system propertyValueBuilder
systemProperty(String name, String defaultValue)
Returns a value builder for the given system propertyValueBuilder
xpath(String value)
Returns a xpath expression value builderValueBuilder
xpath(String value, Class<?> resultType)
Returns a xpath expression value builderValueBuilder
xpath(String value, Class<?> resultType, org.apache.camel.support.builder.Namespaces namespaces)
Returns a xpath expression value builderValueBuilder
xpath(String value, org.apache.camel.support.builder.Namespaces namespaces)
Returns a xpath expression value builder
-
-
-
Method Detail
-
expression
public ValueBuilder expression(org.apache.camel.Expression exp)
Returns a value builder for the given expression
-
header
public ValueBuilder header(String name)
Returns a value builder for the given header
-
exchangeProperty
public ValueBuilder exchangeProperty(String name)
Returns a value builder for the given exchange property
-
body
public ValueBuilder body()
Returns a predicate and value builder for the inbound body on an exchange
-
bodyAs
public <T> ValueBuilder bodyAs(Class<T> type)
Returns a predicate and value builder for the inbound message body as a specific type
-
systemProperty
public ValueBuilder systemProperty(String name)
Returns a value builder for the given system property
-
systemProperty
public ValueBuilder systemProperty(String name, String defaultValue)
Returns a value builder for the given system property
-
constant
public ValueBuilder constant(Object value)
Returns a constant expression value builder
-
constant
public ValueBuilder constant(Object value, boolean trim)
Returns a constant expression value builder
-
constant
public ValueBuilder constant(Object... value)
Returns a constant expression value builder
-
joor
public ValueBuilder joor(String value)
Returns a JOOR expression value builder
-
joor
public ValueBuilder joor(String value, Class<?> resultType)
Returns a JOOR expression value builder
-
jsonpath
public ValueBuilder jsonpath(String value)
Returns a JSonPath expression value builder
-
jsonpath
public ValueBuilder jsonpath(String value, Class<?> resultType)
Returns a JSonPath expression value builder- Parameters:
value
- The JSonPath expressionresultType
- The result type that the JSonPath expression will return.
-
csimple
public ValueBuilder csimple(String value)
Returns a compiled simple expression value builder
-
csimple
public ValueBuilder csimple(String value, Class<?> resultType)
Returns a compiled simple expression value builder
-
datasonnet
public ValueBuilder datasonnet(String value)
Returns a datasonnet expression value builder
-
datasonnet
public ValueBuilder datasonnet(String value, Class<?> resultType)
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
public ValueBuilder simple(String value)
Returns a simple expression value builder
-
simple
public ValueBuilder simple(String value, Class<?> resultType)
Returns a simple expression value builder
-
simpleF
public ValueBuilder simpleF(String format, Object... values)
Returns a simple expression value builder, using String.format style
-
simpleF
public ValueBuilder simpleF(String format, Class<?> resultType, Object... values)
Returns a simple expression value builder, using String.format style
-
xpath
public ValueBuilder xpath(String value)
Returns a xpath expression value builder- Parameters:
value
- the XPath expression- Returns:
- the builder
-
xpath
public ValueBuilder xpath(String value, Class<?> resultType)
Returns a xpath expression value builder- Parameters:
value
- the XPath expressionresultType
- the result type that the XPath expression will return.- Returns:
- the builder
-
xpath
public ValueBuilder xpath(String value, org.apache.camel.support.builder.Namespaces namespaces)
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
public ValueBuilder method(Object beanOrBeanRef)
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
public ValueBuilder method(Object beanOrBeanRef, String 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
public ValueBuilder method(Class<?> beanType)
Returns a method call expression value builder- Parameters:
beanType
- the Class of the bean which we want to invoke- Returns:
- the builder
-
method
public ValueBuilder method(Class<?> beanType, String 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
public ValueBuilder 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
public DefaultErrorHandlerBuilder defaultErrorHandler()
Creates a default error handler.- Returns:
- the builder
-
noErrorHandler
public NoErrorHandlerBuilder noErrorHandler()
Creates a disabled error handler for removing the default error handler- Returns:
- the builder
-
deadLetterChannel
public DeadLetterChannelBuilder deadLetterChannel(String deadLetterUri)
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
public DeadLetterChannelBuilder 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.- Parameters:
deadLetterEndpoint
- dead letter endpoint storing dead messages- Returns:
- the builder
-
jtaTransactionErrorHandler
public JtaTransactionErrorHandlerBuilder 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
public JtaTransactionErrorHandlerBuilder jtaTransactionErrorHandler(String policyRef)
Error handler using JTA transactions (requires camel-jta).- Parameters:
policyRef
- references to the transaction policy- Returns:
- the builder
-
springTransactionErrorHandler
public SpringTransactionErrorHandlerBuilder 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
public SpringTransactionErrorHandlerBuilder springTransactionErrorHandler(String policyRef)
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
-
-