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 protectedBuilderSupport()protectedBuilderSupport(org.apache.camel.CamelContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ValueBuilderbody()Returns a predicate and value builder for the inbound body on an exchange<T> ValueBuilderbodyAs(Class<T> type)Returns a predicate and value builder for the inbound message body as a specific typeValueBuilderconstant(Object value)Returns a constant expression value builderValueBuilderconstant(Object... value)Returns a constant expression value builderValueBuilderconstant(Object value, boolean trim)Returns a constant expression value builderprotected org.apache.camel.ErrorHandlerFactorycreateErrorHandlerBuilder()ValueBuildercsimple(String value)Returns a compiled simple expression value builderValueBuildercsimple(String value, Class<?> resultType)Returns a compiled simple expression value builderValueBuilderdatasonnet(String value)Returns a datasonnet expression value builderValueBuilderdatasonnet(String value, Class<?> resultType)Returns a datasonnet expression value builderValueBuilderdatasonnet(String value, Class<?> resultType, String bodyMediaType, String outputMediaType)Returns a datasonnet expression value builderDeadLetterChannelBuilderdeadLetterChannel(String deadLetterUri)Dead Letter Channel EIP: is a error handler for handling messages that could not be delivered to it's intended destination.DeadLetterChannelBuilderdeadLetterChannel(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.DefaultErrorHandlerBuilderdefaultErrorHandler()Creates a default error handler.org.apache.camel.Endpointendpoint(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.ValueBuilderexceptionMessage()Returns a exception expression value builderValueBuilderexchangeProperty(String name)Returns a value builder for the given exchange propertyorg.apache.camel.CamelContextgetCamelContext()org.apache.camel.CamelContextgetContext()Get theCamelContextorg.apache.camel.ErrorHandlerFactorygetErrorHandlerFactory()booleanhasErrorHandlerFactory()ValueBuilderheader(String name)Returns a value builder for the given headerValueBuilderjoor(String value)Returns a JOOR expression value builderValueBuilderjoor(String value, Class<?> resultType)Returns a JOOR expression value builderValueBuilderjsonpath(String value)Returns a JSonPath expression value builderValueBuilderjsonpath(String value, Class<?> resultType)Returns a JSonPath expression value builderJtaTransactionErrorHandlerBuilderjtaTransactionErrorHandler()Error handler using JTA transactions (requires camel-jta).JtaTransactionErrorHandlerBuilderjtaTransactionErrorHandler(String policyRef)Error handler using JTA transactions (requires camel-jta).JtaTransactionErrorHandlerBuilderjtaTransactionErrorHandler(org.apache.camel.spi.TransactedPolicy policy)Error handler using JTA transactions (requires camel-jta).ValueBuildermethod(Class<?> beanType)Returns a method call expression value builderValueBuildermethod(Class<?> beanType, String method)Returns a method call expression value builderValueBuildermethod(Object beanOrBeanRef)Returns a method call expression value builderValueBuildermethod(Object beanOrBeanRef, String method)Returns a method call expression value builderNoErrorHandlerBuildernoErrorHandler()Creates a disabled error handler for removing the default error handlerValueBuilderregexReplaceAll(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 replacementValueBuilderregexReplaceAll(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 replacementvoidsetCamelContext(org.apache.camel.CamelContext camelContext)voidsetErrorHandlerFactory(org.apache.camel.ErrorHandlerFactory errorHandlerFactory)Sets the error handler to use with processors created by this builderValueBuildersimple(String value)Returns a simple expression value builderValueBuildersimple(String value, Class<?> resultType)Returns a simple expression value builderValueBuildersimpleF(String format, Class<?> resultType, Object... values)Returns a simple expression value builder, using String.format styleValueBuildersimpleF(String format, Object... values)Returns a simple expression value builder, using String.format styleSpringTransactionErrorHandlerBuilderspringTransactionErrorHandler()Error handler using Spring transactions (requires camel-spring).SpringTransactionErrorHandlerBuilderspringTransactionErrorHandler(String policyRef)Error handler using Spring transactions (requires camel-spring).SpringTransactionErrorHandlerBuilderspringTransactionErrorHandler(org.apache.camel.spi.TransactedPolicy policy)Error handler using Spring transactions (requires camel-spring).ValueBuildersystemProperty(String name)Returns a value builder for the given system propertyValueBuildersystemProperty(String name, String defaultValue)Returns a value builder for the given system propertyValueBuilderxpath(String value)Returns a xpath expression value builderValueBuilderxpath(String value, Class<?> resultType)Returns a xpath expression value builderValueBuilderxpath(String value, Class<?> resultType, org.apache.camel.support.builder.Namespaces namespaces)Returns a xpath expression value builderValueBuilderxpath(String value, org.apache.camel.support.builder.Namespaces namespaces)Returns a xpath expression value builder
-
-
-
Method Detail
-
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 ofEndpointinstances- 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 ofEndpointinstances- 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:
getCamelContextin interfaceorg.apache.camel.CamelContextAware
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext)
- Specified by:
setCamelContextin 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 it an error handler factory was initialized
-
-