This is an automated email from the ASF dual-hosted git repository.

nfilotto pushed a commit to branch CAMEL-17792/doc-message-headers
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 09335cc11fdebfaa11fe1f8158ae901dfa09c21e
Author: Nicolas Filotto <[email protected]>
AuthorDate: Thu Mar 31 19:09:58 2022 +0200

    CAMEL-17792: Add doc about the message headers of camel-mustache
---
 .../org/apache/camel/component/mustache/mustache.json        |  4 ++++
 .../camel-mustache/src/main/docs/mustache-component.adoc     | 12 +++---------
 .../apache/camel/component/mustache/MustacheConstants.java   |  4 ++++
 .../apache/camel/component/mustache/MustacheEndpoint.java    |  2 +-
 4 files changed, 12 insertions(+), 10 deletions(-)

diff --git 
a/components/camel-mustache/src/generated/resources/org/apache/camel/component/mustache/mustache.json
 
b/components/camel-mustache/src/generated/resources/org/apache/camel/component/mustache/mustache.json
index 3899942..a997d0f 100644
--- 
a/components/camel-mustache/src/generated/resources/org/apache/camel/component/mustache/mustache.json
+++ 
b/components/camel-mustache/src/generated/resources/org/apache/camel/component/mustache/mustache.json
@@ -28,6 +28,10 @@
     "autowiredEnabled": { "kind": "property", "displayName": "Autowired 
Enabled", "group": "advanced", "label": "advanced", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": true, "description": "Whether autowiring is 
enabled. This is used for automatic autowiring options (the option must be 
marked as autowired) by looking up in the registry to find if there is a single 
instance of matching type, which t [...]
     "mustacheFactory": { "kind": "property", "displayName": "Mustache 
Factory", "group": "advanced", "label": "advanced", "required": false, "type": 
"object", "javaType": "com.github.mustachejava.MustacheFactory", "deprecated": 
false, "autowired": false, "secret": false, "description": "To use a custom 
MustacheFactory" }
   },
+  "headers": {
+    "MustacheResourceUri": { "kind": "header", "displayName": "", "group": 
"producer", "label": "", "required": false, "javaType": "String", "deprecated": 
false, "deprecationNote": "", "autowired": false, "secret": false, 
"description": "A URI for the template resource to use instead of the 
endpoint." },
+    "MustacheTemplate": { "kind": "header", "displayName": "", "group": 
"producer", "label": "", "required": false, "javaType": "String", "deprecated": 
false, "deprecationNote": "", "autowired": false, "secret": false, 
"description": "The template to use instead of the endpoint configured." }
+  },
   "properties": {
     "resourceUri": { "kind": "path", "displayName": "Resource Uri", "group": 
"producer", "label": "", "required": true, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "Path to the resource. You can prefix 
with: classpath, file, http, ref, or bean. classpath, file and http loads the 
resource using these protocols (classpath is default). ref will lookup the 
resource in the registry. bean will [...]
     "allowContextMapAll": { "kind": "parameter", "displayName": "Allow Context 
Map All", "group": "producer", "label": "", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": false, "description": "Sets whether the 
context map should allow access to all details. By default only the message 
body and headers can be accessed. This option can be enabled for full access to 
the current Exchange and CamelContext. [...]
diff --git a/components/camel-mustache/src/main/docs/mustache-component.adoc 
b/components/camel-mustache/src/main/docs/mustache-component.adoc
index 320bdd3..3d79e2d 100644
--- a/components/camel-mustache/src/main/docs/mustache-component.adoc
+++ b/components/camel-mustache/src/main/docs/mustache-component.adoc
@@ -86,15 +86,9 @@ location for a template or the template content itself. If 
any of these
 headers is set then Camel uses this over the endpoint configured
 resource. This allows you to provide a dynamic template at runtime.
 
-[width="100%",cols="10%,10%,10%,70%",options="header",]
-|=======================================================================
-|Header |Type |Description |Support Version
-
-|MustacheConstants.MUSTACHE_RESOURCE_URI |String |A URI for the template 
resource to use instead of the endpoint
-configured. | 
-
-|MustacheConstants.MUSTACHE_TEMPLATE |String |The template to use instead of 
the endpoint configured. |
-|=======================================================================
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 == Samples
 
diff --git 
a/components/camel-mustache/src/main/java/org/apache/camel/component/mustache/MustacheConstants.java
 
b/components/camel-mustache/src/main/java/org/apache/camel/component/mustache/MustacheConstants.java
index c68a492..05880f7 100644
--- 
a/components/camel-mustache/src/main/java/org/apache/camel/component/mustache/MustacheConstants.java
+++ 
b/components/camel-mustache/src/main/java/org/apache/camel/component/mustache/MustacheConstants.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.mustache;
 
+import org.apache.camel.spi.Metadata;
+
 /**
  * Mustache component constants
  */
@@ -24,11 +26,13 @@ public final class MustacheConstants {
     /**
      * Header containing a Mustache template location
      */
+    @Metadata(description = "A URI for the template resource to use instead of 
the endpoint.", javaType = "String")
     public static final String MUSTACHE_RESOURCE_URI = "MustacheResourceUri";
 
     /**
      * Header containing the Mustache template code
      */
+    @Metadata(description = "The template to use instead of the endpoint 
configured.", javaType = "String")
     public static final String MUSTACHE_TEMPLATE = "MustacheTemplate";
 
     /**
diff --git 
a/components/camel-mustache/src/main/java/org/apache/camel/component/mustache/MustacheEndpoint.java
 
b/components/camel-mustache/src/main/java/org/apache/camel/component/mustache/MustacheEndpoint.java
index a8da82b..4023757 100644
--- 
a/components/camel-mustache/src/main/java/org/apache/camel/component/mustache/MustacheEndpoint.java
+++ 
b/components/camel-mustache/src/main/java/org/apache/camel/component/mustache/MustacheEndpoint.java
@@ -44,7 +44,7 @@ import static 
org.apache.camel.component.mustache.MustacheConstants.MUSTACHE_TEM
  * Transform messages using a Mustache template.
  */
 @UriEndpoint(firstVersion = "2.12.0", scheme = "mustache", title = "Mustache", 
syntax = "mustache:resourceUri",
-             producerOnly = true, category = { Category.TRANSFORMATION })
+             producerOnly = true, category = { Category.TRANSFORMATION }, 
headersClass = MustacheConstants.class)
 public class MustacheEndpoint extends ResourceEndpoint {
 
     private MustacheFactory mustacheFactory;

Reply via email to