Class PropertyBindingSupport.Builder

java.lang.Object
org.apache.camel.support.PropertyBindingSupport.Builder
Enclosing class:
PropertyBindingSupport

public static class PropertyBindingSupport.Builder extends Object
To use a fluent builder style to configure this property binding support.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • withCamelContext

      public PropertyBindingSupport.Builder withCamelContext(org.apache.camel.CamelContext camelContext)
      CamelContext to be used
    • withTarget

      public PropertyBindingSupport.Builder withTarget(Object target)
      Target object that should have parameters bound
    • withProperties

      public PropertyBindingSupport.Builder withProperties(Map<String,Object> properties)
      The properties to use for binding
    • withProperty

      public PropertyBindingSupport.Builder withProperty(String key, Object value)
      Adds property to use for binding
    • withRemoveParameters

      public PropertyBindingSupport.Builder withRemoveParameters(boolean removeParameters)
      Whether parameters should be removed when its bound
    • withFlattenProperties

      public PropertyBindingSupport.Builder withFlattenProperties(boolean flattenProperties)
      Whether properties should be flattened (when properties is a map of maps).
    • withMandatory

      public PropertyBindingSupport.Builder withMandatory(boolean mandatory)
      Whether all parameters should be mandatory and successfully bound
    • withOptional

      public PropertyBindingSupport.Builder withOptional(boolean optional)
      Whether parameters can be optional such as configuring endpoints that are lenient
    • withNesting

      public PropertyBindingSupport.Builder withNesting(boolean nesting)
      Whether nesting is in use
    • withDeepNesting

      public PropertyBindingSupport.Builder withDeepNesting(boolean deepNesting)
      Whether deep nesting is in use, where Camel will attempt to walk as deep as possible by creating new objects in the OGNL graph if a property has a setter and the object can be created from a default no-arg constructor.
    • withReference

      public PropertyBindingSupport.Builder withReference(boolean reference)
      Whether reference parameter (syntax starts with #) is in use
    • withPlaceholder

      public PropertyBindingSupport.Builder withPlaceholder(boolean placeholder)
      Whether to use Camels property placeholder to resolve placeholders on keys and values
    • withFluentBuilder

      public PropertyBindingSupport.Builder withFluentBuilder(boolean fluentBuilder)
      Whether fluent builder is allowed as a valid getter/setter
    • withAllowPrivateSetter

      public PropertyBindingSupport.Builder withAllowPrivateSetter(boolean allowPrivateSetter)
      Whether properties should be filtered by prefix. * Note that the prefix is removed from the key before the property is bound.
    • withIgnoreCase

      public PropertyBindingSupport.Builder withIgnoreCase(boolean ignoreCase)
      Whether to ignore case in the property names (keys).
    • withOptionPrefix

      public PropertyBindingSupport.Builder withOptionPrefix(String optionPrefix)
      Whether properties should be filtered by prefix. Note that the prefix is removed from the key before the property is bound.
    • withConfigurer

      public PropertyBindingSupport.Builder withConfigurer(org.apache.camel.spi.PropertyConfigurer configurer)
      Whether to use the configurer to configure the properties.
    • withReflection

      public PropertyBindingSupport.Builder withReflection(boolean reflection)
      Whether to allow using reflection (when there is no configurer available).
    • withListener

      To use the property binding listener.
    • bind

      public boolean bind()
      Binds the properties to the target object, and removes the property that was bound from properties.
      Returns:
      true if one or more properties was bound
    • bind

      public boolean bind(org.apache.camel.CamelContext camelContext, Object target, Map<String,Object> properties)
      Binds the properties to the target object, and removes the property that was bound from properties.
      Parameters:
      camelContext - the camel context
      target - the target object
      properties - the properties where the bound properties will be removed from
      Returns:
      true if one or more properties was bound
    • bind

      public boolean bind(org.apache.camel.CamelContext camelContext, Object target, String key, Object value)
      Binds the property to the target object.
      Parameters:
      camelContext - the camel context
      target - the target object
      key - the property key
      value - the property value
      Returns:
      true if the property was bound