Class Builder

java.lang.Object
org.apache.camel.builder.Builder

public final class Builder extends Object
A helper class for including portions of the expression and predicate Java DSL

Implementation of this builder should favor build expressions using the definition classes from the org.apache.camel.model.language package, to build the routes using the same types as it would happen when using XML DSL.

  • Method Details

    • method

      public static 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 static 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 Registry
      method - the method name
      Returns:
      the builder
    • method

      public static ValueBuilder method(Class<?> beanType, String method)
      Returns a method call expression value builder
      Parameters:
      beanType - the bean class which will be invoked
      method - name of method to invoke
      Returns:
      the builder
    • constant

      public static ValueBuilder constant(Object value)
      Returns a constant expression
    • constant

      public static ValueBuilder constant(String value, Class<?> resultType)
      Returns a constant expression
    • constant

      public static ValueBuilder constant(Object value, boolean trim)
      Returns a constant expression
    • language

      public static ValueBuilder language(String language, String expression)
      Returns a constant expression
    • csimple

      public static ValueBuilder csimple(String value)
      Returns a csimple expression
    • csimple

      public static ValueBuilder csimple(String value, Class<?> resultType)
      Returns a csimple expression
    • simple

      public static ValueBuilder simple(String value)
      Returns a simple expression
    • simple

      public static ValueBuilder simple(String value, Class<?> resultType)
      Returns a simple expression
    • joor

      public static ValueBuilder joor(String value)
      Returns a JOOR expression value builder
    • joor

      public static ValueBuilder joor(String value, Class<?> resultType)
      Returns a JOOR expression value builder
    • jq

      public static ValueBuilder jq(String value)
      Returns a JQ expression value builder
    • jq

      public static ValueBuilder jq(String value, Class<?> resultType)
      Returns a JQ expression value builder
    • jsonpath

      public static ValueBuilder jsonpath(String value)
      Returns a JSonPath expression value builder
    • jsonpath

      public static ValueBuilder jsonpath(String value, Class<?> resultType)
      Returns a JSonPath expression value builder
      Parameters:
      value - The JSonPath expression
      resultType - The result type that the JSonPath expression will return.
    • header

      public static ValueBuilder header(String name)
      Returns a predicate and value builder for headers on an exchange
    • exchangeProperty

      public static ValueBuilder exchangeProperty(String name)
      Returns a predicate and value builder for properties on an exchange
    • body

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

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

      public static ValueBuilder systemProperty(String name)
      Returns an expression for the given system property
    • systemProperty

      public static ValueBuilder systemProperty(String name, String defaultValue)
      Returns an expression for the given system property
    • exceptionMessage

      public static ValueBuilder exceptionMessage()
      Returns a predicate and value builder for the exception message on an exchange
    • exceptionStackTrace

      public static ValueBuilder exceptionStackTrace()
      Returns a predicate and value builder for the exception stacktrace on an exchange
    • regexReplaceAll

      public static ValueBuilder regexReplaceAll(org.apache.camel.Expression content, String regex, String replacement)
      Returns an expression that replaces all occurrences of the regular expression with the given replacement
    • regexReplaceAll

      public static ValueBuilder regexReplaceAll(org.apache.camel.Expression content, String regex, org.apache.camel.Expression replacement)
      Returns an expression that replaces all occurrences of the regular expression with the given replacement