This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new ade0e12 Update properties-component.adoc (#5908)
ade0e12 is described below
commit ade0e129dad99cc50d931ada834e6d27cc5ae257
Author: LittleEntity <[email protected]>
AuthorDate: Mon Aug 2 17:29:39 2021 +0200
Update properties-component.adoc (#5908)
as a newbie to camel I had a hard time finding the method
`resolveProperty`. I used
`this.getContext().resolvePropertyPlaceholders("{{myProperty}}");`. This code
reads itself much better:
`this.getContext().getPropertiesComponent().resolveProperty("pFile20WorkingDir").orElseThrow();`
It also allows us to give default values via the `Optional` type and eases
error handling.
---
core/camel-base/src/main/docs/properties-component.adoc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/core/camel-base/src/main/docs/properties-component.adoc
b/core/camel-base/src/main/docs/properties-component.adoc
index 4a7eb02..cb2ec73 100644
--- a/core/camel-base/src/main/docs/properties-component.adoc
+++ b/core/camel-base/src/main/docs/properties-component.adoc
@@ -36,8 +36,8 @@ The component supports 10 options, which are listed below.
[TIP]
**Resolving property from Java code** +
-You can use the method `resolvePropertyPlaceholders` on the
-`CamelContext` to resolve a property from any Java code.
+You can use the method `resolveProperty` on the `PropertiesComponent` to
resolve a property from Java code.
+Or use the method `resolvePropertyPlaceholders` on the `CamelContext` to
resolve property placeholders in a string.
== Using PropertyPlaceholder