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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
