public final class PropertyBindingSupport extends Object
IntrospectionSupport
.Modifier and Type | Class and Description |
---|---|
static class |
PropertyBindingSupport.Builder
To use a fluent builder style to configure this property binding support.
|
static interface |
PropertyBindingSupport.OnAutowiring |
Modifier and Type | Method and Description |
---|---|
static boolean |
autowireSingletonPropertiesFromRegistry(org.apache.camel.CamelContext camelContext,
Object target)
This will discover all the properties on the target, and automatic bind the properties that are null by
looking up in the registry to see if there is a single instance of the same type as the property.
|
static boolean |
autowireSingletonPropertiesFromRegistry(org.apache.camel.CamelContext camelContext,
Object target,
boolean bindNullOnly,
boolean deepNesting,
PropertyBindingSupport.OnAutowiring callback)
This will discover all the properties on the target, and automatic bind the properties by
looking up in the registry to see if there is a single instance of the same type as the property.
|
static void |
bindMandatoryProperty(org.apache.camel.CamelContext camelContext,
Object target,
String name,
Object value)
Binds the mandatory property to the target object (will fail if not set/bound).
|
static boolean |
bindProperties(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.
|
static boolean |
bindProperties(org.apache.camel.CamelContext camelContext,
Object target,
Map<String,Object> properties,
boolean nesting,
boolean deepNesting,
boolean fluentBuilder,
boolean reference,
boolean placeholder)
Binds the properties to the target object, and removes the property that was bound from properties.
|
static boolean |
bindProperty(org.apache.camel.CamelContext camelContext,
Object target,
String name,
Object value)
Binds the property to the target object.
|
static PropertyBindingSupport.Builder |
build() |
public static PropertyBindingSupport.Builder build()
public static boolean autowireSingletonPropertiesFromRegistry(org.apache.camel.CamelContext camelContext, Object target)
camelContext
- the camel contexttarget
- the target objectpublic static boolean autowireSingletonPropertiesFromRegistry(org.apache.camel.CamelContext camelContext, Object target, boolean bindNullOnly, boolean deepNesting, PropertyBindingSupport.OnAutowiring callback)
camelContext
- the camel contexttarget
- the target objectbindNullOnly
- whether to only autowire if the property has no default value or has not been configured explicitdeepNesting
- whether to attempt to walk as deep down the object graph by creating new empty objects on the way if needed (Camel can only create
new empty objects if they have a default no-arg constructor, also mind that this may lead to creating many empty objects, even
if they will not have any objects autowired from the registry, so use this with caution)callback
- optional callback when a property was auto wiredpublic static boolean bindProperties(org.apache.camel.CamelContext camelContext, Object target, Map<String,Object> properties)
camelContext
- the camel contexttarget
- the target objectproperties
- the properties where the bound properties will be removed frompublic static boolean bindProperties(org.apache.camel.CamelContext camelContext, Object target, Map<String,Object> properties, boolean nesting, boolean deepNesting, boolean fluentBuilder, boolean reference, boolean placeholder)
camelContext
- the camel contexttarget
- the target objectproperties
- the properties where the bound properties will be removed fromnesting
- whether nesting is in usedeepNesting
- 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.fluentBuilder
- whether fluent builder is allowed as a valid getter/setterreference
- whether reference parameter (syntax starts with #) is in useplaceholder
- whether to use Camels property placeholder to resolve placeholders on keys and valuespublic static boolean bindProperty(org.apache.camel.CamelContext camelContext, Object target, String name, Object value)
camelContext
- the camel contexttarget
- the target objectname
- name of propertyvalue
- value of propertypublic static void bindMandatoryProperty(org.apache.camel.CamelContext camelContext, Object target, String name, Object value)
camelContext
- the camel contexttarget
- the target objectname
- name of propertyvalue
- value of propertyApache Camel