Interface PropertiesFunction
public interface PropertiesFunction
Extension point for the
PropertiesComponent that handles property placeholders of the form
{{name:remainder}}, where name matches getName().
Functions are registered with PropertiesComponent.addPropertiesFunction(PropertiesFunction) and are tried
before (or after, depending on lookupFirst(String)) the normal property-source lookup chain. The
apply(String) method receives the part after the colon separator and returns the resolved value. Built-in
functions include env: (environment variables), sys: (system properties), and secret: (cloud
vault lookups). Custom functions can implement arbitrary resolution logic, such as decrypting encrypted values,
fetching from a database, or generating dynamic tokens.
See Using Property Placeholder in the
Camel user manual.- Since:
- 3.3
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionApplies the function.getName()Name of the function which is used as name: to let the properties component know it is a function.default booleanlookupFirst(String remainder) Whether the value should be looked up as a regular properties first, before applying this function.default booleanIf the property value cannot be found should the property be regarded as optional and ignore missing value.
-
Method Details
-
getName
String getName()Name of the function which is used as name: to let the properties component know it is a function. -
apply
-
lookupFirst
Whether the value should be looked up as a regular properties first, before applying this function.- Parameters:
remainder- the remainder value- Returns:
- true to resolve the remainder value as a property value, and then afterwards apply this function, false to apply this function without lookup (default).
-
optional
If the property value cannot be found should the property be regarded as optional and ignore missing value.- Parameters:
remainder- the remainder value- Returns:
- true to make this property as optional
-