org.apache.camel.builder
Class BuilderSupport

java.lang.Object
  extended by org.apache.camel.builder.BuilderSupport
Direct Known Subclasses:
RouteBuilder

public abstract class BuilderSupport
extends Object

Base class for implementation inheritance for different clauses in the Java DSL

Version:

Constructor Summary
protected BuilderSupport(CamelContext context)
           
 
Method Summary
 ValueBuilder bean(Class<?> beanType)
          Returns a bean expression value builder
 ValueBuilder bean(Class<?> beanType, String method)
          Returns a bean expression value builder
 ValueBuilder bean(Object beanOrBeanRef)
          Returns a bean expression value builder

This method accepts dual parameters.

 ValueBuilder bean(Object beanOrBeanRef, String method)
          Returns a bean expression value builder

This method accepts dual parameters.

 ValueBuilder body()
          Returns a predicate and value builder for the inbound body on an exchange
<T> ValueBuilder
body(Class<T> type)
          Returns a predicate and value builder for the inbound message body as a specific type
 ValueBuilder constant(Object value)
          Returns a constant expression value builder
protected  ErrorHandlerBuilder createErrorHandlerBuilder()
           
 DeadLetterChannelBuilder deadLetterChannel(Endpoint deadLetterEndpoint)
          Dead Letter Channel EIP: is a error handler for handling messages that could not be delivered to it's intended destination.
 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.
 DefaultErrorHandlerBuilder defaultErrorHandler()
          Creates a default error handler.
 Endpoint endpoint(String uri)
          Resolves the given URI to an endpoint
<T extends Endpoint>
T
endpoint(String uri, Class<T> type)
          Resolves the given URI to an endpoint of the specified type
 List<Endpoint> endpoints(Endpoint... endpoints)
          Helper method to create a list of Endpoint instances
 List<Endpoint> endpoints(String... uris)
          Resolves the list of URIs into a list of Endpoint instances
 ValueBuilder exceptionMessage()
          Returns a exception expression value builder
 ValueBuilder faultBody()
          Returns a predicate and value builder for the fault body on an exchange
<T> ValueBuilder
faultBodyAs(Class<T> type)
          Returns a predicate and value builder for the fault message body as a specific type
 ModelCamelContext getContext()
           
 ErrorHandlerBuilder getErrorHandlerBuilder()
           
 ValueBuilder header(String name)
          Returns a value builder for the given header
 LoggingErrorHandlerBuilder loggingErrorHandler()
          Creates an error handler which just logs errors
 LoggingErrorHandlerBuilder loggingErrorHandler(org.slf4j.Logger log)
          Creates an error handler which just logs errors
 LoggingErrorHandlerBuilder loggingErrorHandler(org.slf4j.Logger log, LoggingLevel level)
          Creates an error handler which just logs errors
 LoggingErrorHandlerBuilder loggingErrorHandler(String log)
          Creates an error handler which just logs errors
 NoErrorHandlerBuilder noErrorHandler()
          Creates a disabled error handler for removing the default error handler
 ValueBuilder outBody()
          Returns a predicate and value builder for the outbound body on an exchange
<T> ValueBuilder
outBody(Class<T> type)
          Returns a predicate and value builder for the outbound message body as a specific type
 ValueBuilder property(String name)
          Returns a value builder for the given property
 ValueBuilder regexReplaceAll(Expression content, String regex, Expression replacement)
          Returns an expression value builder that replaces all occurrences of the regular expression with the given replacement
 ValueBuilder regexReplaceAll(Expression content, String regex, String replacement)
          Returns an expression value builder that replaces all occurrences of the regular expression with the given replacement
 ValueBuilder sendTo(String uri)
          Returns an expression processing the exchange to the given endpoint uri
 void setContext(CamelContext context)
          Deprecated. 
 void setContext(ModelCamelContext context)
           
 void setErrorHandlerBuilder(ErrorHandlerBuilder errorHandlerBuilder)
          Sets the error handler to use with processors created by this builder
 SimpleBuilder simple(String value)
          Returns a simple expression value builder
 SimpleBuilder simple(String value, Class<?> resultType)
          Returns a simple expression value builder
 ValueBuilder systemProperty(String name)
          Returns a value builder for the given system property
 ValueBuilder systemProperty(String name, String defaultValue)
          Returns a value builder for the given system property
 XPathBuilder xpath(String value)
          Returns a xpath expression value builder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuilderSupport

protected BuilderSupport(CamelContext context)
Method Detail

header

public ValueBuilder header(String name)
Returns a value builder for the given header


property

public ValueBuilder property(String name)
Returns a value builder for the given property


body

public ValueBuilder body()
Returns a predicate and value builder for the inbound body on an exchange


body

public <T> ValueBuilder body(Class<T> type)
Returns a predicate and value builder for the inbound message body as a specific type


outBody

public ValueBuilder outBody()
Returns a predicate and value builder for the outbound body on an exchange


outBody

public <T> ValueBuilder outBody(Class<T> type)
Returns a predicate and value builder for the outbound message body as a specific type


faultBody

public ValueBuilder faultBody()
Returns a predicate and value builder for the fault body on an exchange


faultBodyAs

public <T> ValueBuilder faultBodyAs(Class<T> type)
Returns a predicate and value builder for the fault 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


simple

public SimpleBuilder simple(String value)
Returns a simple expression value builder


simple

public SimpleBuilder simple(String value,
                            Class<?> resultType)
Returns a simple expression value builder


xpath

public XPathBuilder xpath(String value)
Returns a xpath expression value builder


bean

public ValueBuilder bean(Object beanOrBeanRef)
Returns a bean 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

bean

public ValueBuilder bean(Object beanOrBeanRef,
                         String method)
Returns a bean 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
method - name of method to invoke
Returns:
the builder

bean

public ValueBuilder bean(Class<?> beanType)
Returns a bean expression value builder

Parameters:
beanType - the Class of the bean which we want to invoke
Returns:
the builder

bean

public ValueBuilder bean(Class<?> beanType,
                         String method)
Returns a bean expression value builder

Parameters:
beanType - the Class of the bean which we want to invoke
method - name of method to invoke
Returns:
the builder

sendTo

public ValueBuilder sendTo(String uri)
Returns an expression processing the exchange to the given endpoint uri

Parameters:
uri - endpoint uri to send the exchange to
Returns:
the builder

regexReplaceAll

public ValueBuilder regexReplaceAll(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(Expression content,
                                    String regex,
                                    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

public Endpoint endpoint(String uri)
                  throws NoSuchEndpointException
Resolves the given URI to an endpoint

Parameters:
uri - the uri to resolve
Returns:
the endpoint
Throws:
NoSuchEndpointException - if the endpoint URI could not be resolved

endpoint

public <T extends Endpoint> T endpoint(String uri,
                                       Class<T> type)
                            throws NoSuchEndpointException
Resolves the given URI to an endpoint of the specified type

Parameters:
uri - the uri to resolve
type - the excepted type of the endpoint
Returns:
the endpoint
Throws:
NoSuchEndpointException - if the endpoint URI could not be resolved

endpoints

public List<Endpoint> endpoints(String... uris)
                         throws NoSuchEndpointException
Resolves the list of URIs into a list of Endpoint instances

Parameters:
uris - list of endpoints to resolve
Returns:
list of endpoints
Throws:
NoSuchEndpointException - if an endpoint URI could not be resolved

endpoints

public List<Endpoint> endpoints(Endpoint... endpoints)
Helper method to create a list of Endpoint 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

loggingErrorHandler

public LoggingErrorHandlerBuilder loggingErrorHandler()
Creates an error handler which just logs errors

Returns:
the builder

loggingErrorHandler

public LoggingErrorHandlerBuilder loggingErrorHandler(String log)
Creates an error handler which just logs errors

Returns:
the builder

loggingErrorHandler

public LoggingErrorHandlerBuilder loggingErrorHandler(org.slf4j.Logger log)
Creates an error handler which just logs errors

Returns:
the builder

loggingErrorHandler

public LoggingErrorHandlerBuilder loggingErrorHandler(org.slf4j.Logger log,
                                                      LoggingLevel level)
Creates an error handler which just logs errors

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(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

getContext

public ModelCamelContext getContext()

setContext

@Deprecated
public void setContext(CamelContext context)
Deprecated. 


setContext

public void setContext(ModelCamelContext context)

getErrorHandlerBuilder

public ErrorHandlerBuilder getErrorHandlerBuilder()

createErrorHandlerBuilder

protected ErrorHandlerBuilder createErrorHandlerBuilder()

setErrorHandlerBuilder

public void setErrorHandlerBuilder(ErrorHandlerBuilder errorHandlerBuilder)
Sets the error handler to use with processors created by this builder



Apache CAMEL