Package org.apache.camel.support
Class PropertyBindingSupport.Builder
java.lang.Object
org.apache.camel.support.PropertyBindingSupport.Builder
- Enclosing class:
- PropertyBindingSupport
To use a fluent builder style to configure this property binding support.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
bind()
Binds the properties to the target object, and removes the property that was bound from properties.boolean
Binds the property to the target object.boolean
Binds the properties to the target object, and removes the property that was bound from properties.withAllowPrivateSetter
(boolean allowPrivateSetter) Whether properties should be filtered by prefix.withCamelContext
(org.apache.camel.CamelContext camelContext) CamelContext to be usedwithConfigurer
(org.apache.camel.spi.PropertyConfigurer configurer) Whether to use the configurer to configure the properties.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.withFlattenProperties
(boolean flattenProperties) Whether properties should be flattened (when properties is a map of maps).withFluentBuilder
(boolean fluentBuilder) Whether fluent builder is allowed as a valid getter/setterwithIgnoreCase
(boolean ignoreCase) Whether to ignore case in the property names (keys).withListener
(PropertyBindingListener listener) To use the property binding listener.withMandatory
(boolean mandatory) Whether all parameters should be mandatory and successfully boundwithNesting
(boolean nesting) Whether nesting is in usewithOptional
(boolean optional) Whether parameters can be optional such as configuring endpoints that are lenientwithOptionPrefix
(String optionPrefix) Whether properties should be filtered by prefix.withPlaceholder
(boolean placeholder) Whether to use Camels property placeholder to resolve placeholders on keys and valueswithProperties
(Map<String, Object> properties) The properties to use for bindingwithProperty
(String key, Object value) Adds property to use for bindingwithReference
(boolean reference) Whether reference parameter (syntax starts with #) is in usewithReflection
(boolean reflection) Whether to allow using reflection (when there is no configurer available).withRemoveParameters
(boolean removeParameters) Whether parameters should be removed when its boundwithTarget
(Object target) Target object that should have parameters bound
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
withCamelContext
CamelContext to be used -
withTarget
Target object that should have parameters bound -
withProperties
The properties to use for binding -
withProperty
Adds property to use for binding -
withRemoveParameters
Whether parameters should be removed when its bound -
withFlattenProperties
Whether properties should be flattened (when properties is a map of maps). -
withMandatory
Whether all parameters should be mandatory and successfully bound -
withOptional
Whether parameters can be optional such as configuring endpoints that are lenient -
withNesting
Whether nesting is in use -
withDeepNesting
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
Whether reference parameter (syntax starts with #) is in use -
withPlaceholder
Whether to use Camels property placeholder to resolve placeholders on keys and values -
withFluentBuilder
Whether fluent builder is allowed as a valid getter/setter -
withAllowPrivateSetter
Whether properties should be filtered by prefix. * Note that the prefix is removed from the key before the property is bound. -
withIgnoreCase
Whether to ignore case in the property names (keys). -
withOptionPrefix
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
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 contexttarget
- the target objectproperties
- 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 contexttarget
- the target objectkey
- the property keyvalue
- the property value- Returns:
- true if the property was bound
-