You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/06/21 09:57:52 UTC

[GitHub] [camel] essobedo opened a new pull request, #7839: CAMEL-18141: camel-endpoint-dsl - Generate fluent builders for endpoint headers

essobedo opened a new pull request, #7839:
URL: https://github.com/apache/camel/pull/7839

   Fixes https://issues.apache.org/jira/browse/CAMEL-18141
   
   ## Motivation
   
   Now that every component has marked up the headers it supports, we can use that to generate fluent builders in camel-endpointdsl.
   
   ## Modifications:
   
   * Generates a new static inner class to propose all the headers' name of a component in the corresponding `EndpointBuilderFactory` interface
   * Generates a new method without parameter into the `Builders` interface to have access to the builder of the headers' name. 
   * Adds some doc about this feature
   * Fixes an example of from `Endpoint-dsl.adoc` (not related to the initial issue)
   
   ## Result
   
   Example of what is generated for the file component:
   
   ```
   ...
   @Generated("org.apache.camel.maven.packaging.EndpointDslMojo")
   public interface FileEndpointBuilderFactory {
   ...
       public interface FileBuilders {
           /**
            * File (camel-file)
            * Read and write files.
            * 
            * Category: file,core
            * Since: 1.0
            * Maven coordinates: org.apache.camel:camel-file
            * 
            * @return the dsl builder for the headers' name.
            */
           default FileHeaderNameBuilder file() {
               return FileHeaderNameBuilder.INSTANCE;
           }
           ...
       }
   
       /**
        * The builder of headers' name for the File component.
        */
       public static class FileHeaderNameBuilder {
           /**
            * The internal instance of the builder used to access to all the
            * methods representing the name of headers.
            */
           private static final FileHeaderNameBuilder INSTANCE = new FileHeaderNameBuilder();
   
           /**
            * A long value containing the file size.
            * 
            * The option is a: {@code long} type.
            * 
            * Group: consumer
            * 
            * @return the name of the header {@code FileLength}.
            */
           public String fileLength() {
               return "FileLength";
           }
           ...
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #7839: CAMEL-18141: camel-endpoint-dsl - Generate fluent builders for endpoint headers

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #7839:
URL: https://github.com/apache/camel/pull/7839#issuecomment-1161589099

   :no_entry_sign: There are (likely) no components to be tested in this PR


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] essobedo merged pull request #7839: CAMEL-18141: camel-endpoint-dsl - Generate fluent builders for endpoint headers

Posted by GitBox <gi...@apache.org>.
essobedo merged PR #7839:
URL: https://github.com/apache/camel/pull/7839


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org