public final class CamelPropertiesHelper extends Object
Modifier and Type | Method and Description |
---|---|
static void |
resolvePropertyPlaceholders(org.apache.camel.CamelContext camelContext,
Object target)
Inspects the given object and resolves any property placeholders from its properties.
|
static boolean |
setCamelProperties(org.apache.camel.CamelContext context,
Object target,
Map<String,Object> properties,
boolean failIfNotSet)
Sets the properties on the target bean.
|
public static boolean setCamelProperties(org.apache.camel.CamelContext context, Object target, Map<String,Object> properties, boolean failIfNotSet) throws Exception
context
- the CamelContexttarget
- the target beanproperties
- the propertiesfailIfNotSet
- whether to fail if an option either does not exists on the target bean or if the option cannot be due no suitable setter methods with the given typeIllegalArgumentException
- is thrown if an option cannot be configured on the bean because there is no suitable setter method and failOnNoSet is true.Exception
- for any other kind of errorpublic static void resolvePropertyPlaceholders(org.apache.camel.CamelContext camelContext, Object target) throws Exception
camelContext
- the Camel contexttarget
- the object that should have the properties (eg getter/setter) resolvedException
- is thrown if property placeholders was used and there was an error resolving themCamelContext.resolvePropertyPlaceholders(String)
,
PropertiesComponent
Apache Camel