Skip to content

Ref #1100: Java DSL Formatter - Format Java DSL when it's at start of route#1208

Merged
davsclaus merged 1 commit intocamel-tooling:mainfrom
merkuspunto:1207/format-start-java-dsl
Dec 3, 2025
Merged

Ref #1100: Java DSL Formatter - Format Java DSL when it's at start of route#1208
davsclaus merged 1 commit intocamel-tooling:mainfrom
merkuspunto:1207/format-start-java-dsl

Conversation

@merkuspunto
Copy link
Contributor

Fixes #1100

Motivation

A route beginning with the Java DSL does not get formatted, but the plug-in should format it.

Modifications

  • Include method call expressions when finding the start of a route.

Results

Example of formatted code:

  from(direct("format"))
      .setBody(constant(Map.of("foo", "abc", "bar", 123)))
      .marshal(dataFormat);
  
  from(direct("format"))
      .setBody(constant(Map.of("foo", "abc", "bar", 123)))
      .marshal()
      .csv();
  
  from(direct("format"))
      .setBody(constant(Map.of("foo", "abc", "bar", 123)))
      .marshal(
          dataFormat()
              .csv()
              .delimiter(",")
          .end());

  routeTemplate("template")
      .templateParameter("v1")
      .from(kamelet("source"))
          .setProperty("version", constant("{{version}}"));

@davsclaus
Copy link
Collaborator

Thanks for the PR

@davsclaus davsclaus merged commit 83ded43 into camel-tooling:main Dec 3, 2025
3 checks passed
@merkuspunto merkuspunto deleted the 1207/format-start-java-dsl branch December 19, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code-reformat to indent routes in RouteBuilders not working

2 participants